Ever wonder how file uploads work in PHP? 🤔
When a user submits a file, PHP gives you a special $_FILES array with the name, size, type & temp location.
Teaching this (and more) in my PHP book - follow for tips!
Using Laravel’s Arrayable interface to structure data
✅ Keeps data transformation inside the DTO
✅ Ensures consistency
✅ Eases testing & debugging
The Laravel Microservice course is released on 31st March
Details n discounts 👉 https://t.co/fxjfvAuqXD 🚀
A few months ago, I built a social media system in Laravel that includes a chat feature. Today, I'm sharing a snippet from one of my service classes. How would you suggest improving it?
🐍📰 Python Keywords: An Introduction
There are 35 keywords and four soft keywords in Python. Python keywords are the fundamental building blocks of any Python program. Learn each keyword's basic syntax and usage to write more efficient and readable code.
https://t.co/n5MUh8294G
** Kubernetes deployment manifest file structure explained **
In the Kubernetes deployment YAML we define how an application should be deployed and managed within a Kubernetes cluster.
Below is a breakdown of the YAML structure with explanations.
** Explanation of the key sections **
- apiVersion & kind: Defines that this is a deployment resource and uses apps/v1 Kubernetes API.
- metadata: Contains details like the name and labels for app organization.
- spec.replicas: Defines the desired number of running instances (pods).
- spec.selector.matchLabels: Ensures the deployment controls only pods with matching labels.
- spec.template:
- Defines the pod template (metadata and spec).
- The containers section defines container details such as the image, ports, and resources.
- Environment variables, volume mounts, and resource limits can also be set.
- spec.strategy: Controls the deployment update strategy (RollingUpdate or Recreate).
- volumes: Allows defining persistent storage like ConfigMaps, Secrets, or Persistent Volumes.
** Optional additions **
- Liveness & Readiness Probes (for health checks)
- Affinity & Node Selectors (for scheduling)
- Init Containers (for pre-processing tasks)
#Laravel tip:
Use mapInto() for Transforming Collections into Objects
Instead of using default rate limiting, RateLimiter lets you define custom conditions dynamically.
Convert users into DTO objects without manual mapping:
#Laravel tip:
Use scout for Full-Text Search with Eloquent
Instead of using LIKE queries, Laravel Scout integrates with search engines like MeiliSearch or Algolia.
Make a model searchable and perform a full-text search
Hey Laravel Developers 👩💻
Laravel Horizon is an amazing package that offers more optimizations and monitoring features than basic Laravel queues.
Among its many features, one that I particularly like is Horizon’s ability to trigger notifications on various channels like mail, Slack, and SMS when any of your queues experience a long wait time.
You can also configure what is considered a long wait time for a particular queue based on your application domain.
This option is available inside the config/horizon.php file under the waits configuration.
#laravel #php
Landing a Machine Learning job is like a game.
And you need to play it differently if you wanna win
❌ No more watching Youtube videos.
❌ No more reading Twitter threads.
❌ No more FOMO
Enough of all that.
Go build something.
No pain, no gain.
If you want to see a full source code implementation, check out this top-notch Github repository that Hadeel Als, on my students from the Real World ML Community, has built
⬇️⬇️⬇️
https://t.co/vb8VFTyX7O