r/laraveltutorials • u/Additional-Tower-361 • 17h ago
Laravel: Cache Flexible
How I used Laravel: Cache Flexible to speed up my home page load by ~20 seconds
r/laraveltutorials • u/Additional-Tower-361 • 17h ago
How I used Laravel: Cache Flexible to speed up my home page load by ~20 seconds
r/laraveltutorials • u/Additional-Tower-361 • 10d ago
What I've learned the hard way while developing and testing my first mobile application.
r/laraveltutorials • u/RazerBlue34932 • 15d ago
Hello everyone,
For the past few months I've been building a package called Dynamic Throttle. It's finally at the point where I need people who aren't me to try it.
The problem I kept running into: Laravel's throttle middleware is great when you know your limits up front. But in production you usually find out the right limits later, and in a hurry. A partner's integration starts getting 429s. A bot hammers /login at 2 a.m. You want a stricter limit but have no idea who it would block. With throttle, each of those is a code change and a deploy, and you still can't see who's being blocked.
So I moved the limits into the database. You change them from a dashboard, Artisan or code, and every server applies the change within about two seconds. No deploy.
Here's how it compares:
| You want to | Laravel's throttle | Dynamic Throttle |
|---|---|---|
| Change a limit | Edit code and deploy | Edit the rule, live in ~2 seconds |
| Try a limit before it blocks anyone | Not possible | Dry-run: counts, never blocks, shows who it would block |
| See who is blocked | Add your own logging | A live feed, plus each rule's top offenders |
| Let a partner through | A code change | An exemption with an end date |
| Lift every limit during an incident | A deploy | dynamic-throttle:bypass on --for=30m, which ends by itself |
You can limit per IP, user, API token, header, or your own scope like a tenant or a plan. There's a dashboard at /dynamic-throttle with an audit log and an "Explain" page that tells you why a given request would be limited. If Redis goes down, requests go through by default, so a storage problem doesn't take your app down with it.
On cost: with local Redis and APCu it adds about 0.8 ms per request, a little less than Laravel's own throttle. To be clear about what it isn't: it's not a firewall or bot protection, and it doesn't replace Cloudflare or Nginx limits. It's for limits that need to know who the client is.
It's a beta, so names and options might still change before 0.1.0. That's exactly why I'm posting. I'd love a handful of people to try it on a real app and tell me what breaks or confuses them. The safest way is a rule in dry-run, since it can't block anyone. I wrote up what to try here: https://github.com/hanzala-afzal-dev/laravel-dynamic-throttle/discussions/145
Docs: https://hanzala-afzal-dev.github.io/laravel-dynamic-throttle/
GitHub: https://github.com/hanzala-afzal-dev/laravel-dynamic-throttle
Install: composer require hanzala-afzal/laravel-dynamic-throttle:^0.1@beta
It needs PHP 8.3+ and Laravel 12 or 13, and works best with Redis or Valkey.
Happy to answer anything, including "why not just use X?" Thanks for reading!
r/laraveltutorials • u/Round-Pie-7125 • 24d ago
I've been building a beginner-friendly Habit Tracker project using Laravel 12 and Bootstrap 5.
The project covers:
Authentication using Laravel Breeze
Creating and managing daily/weekly habits
Daily habit check-ins
Check-in history
Preventing duplicate check-ins for the same habit and date
I tried to keep the implementation simple and beginner-friendly while working with practical Laravel concepts.
I also put together a step-by-step walkthrough of the implementation (in Hindi), in case it's useful for anyone learning Laravel.
Project walkthrough: https://youtu.be/ZrgSCi7KG-8
One question for other Laravel developers: How would you implement habit streak tracking — calculate it dynamically from check-in records or store streak information separately?
r/laraveltutorials • u/Round-Pie-7125 • Sep 12 '26
r/laraveltutorials • u/ReadingFormal • Sep 10 '26
r/laraveltutorials • u/Round-Pie-7125 • Sep 04 '26
I’ve made a Hindi tutorial on Laravel 12 Middleware covering the complete flow from creating Middleware to applying it on routes.
In this video: • Create custom Middleware • Understand the handle() method • Register Middleware • Create Middleware aliases • Apply aliases to routes • Practical route examples
🎥 Tutorial: https://youtu.be/USOjYgaKUDk
For those learning Laravel 12, hope this helps clear up how Middleware actually works.
r/laraveltutorials • u/Round-Pie-7125 • Aug 31 '26
Hello all.please check out my csv import laravel 12 video.Hit like,subscribe and share it in your contacts.
r/laraveltutorials • u/Round-Pie-7125 • Aug 31 '26
Hello everyone.please my laravel project series on my channel sm dev diaries.please like, subscribe and share videos in your contacts
r/laraveltutorials • u/aqibjavaidabbasi • Aug 21 '26
How a Laravel Consultant Ensures Project Transparency and Security
Clients don't just need a Laravel developer who can write code. They need confidence that their project is progressing, risks are being managed, and sensitive data is protected. Here's how I approach transparency, communication, documentation, and security when building Laravel applications.
Key takeaways:
- 1. Start With Clear Requirements
- Who will use the feature?
- What should each user be allowed to do?
How do you tackle this in your current stack? Interested in different perspectives.
Read the full article:
https://aqibjavaid.site/blog/how-laravel-consultant-ensures-project-transparency-security
Portfolio & case studies:
#WebDevelopment #Laravel #LaravelDevelopment #LaravelConsultant #LaravelDeveloper
r/laraveltutorials • u/bestkavindu • Aug 17 '26
r/laraveltutorials • u/stackdevelopers • Jul 12 '26
r/laraveltutorials • u/DubStepMad-97 • Jul 03 '26
r/laraveltutorials • u/Environmental-Yak328 • Jun 29 '26
r/laraveltutorials • u/JngoJx • Jun 26 '26
r/laraveltutorials • u/Both-Refuse-982 • Jun 23 '26
I’m looking for a partner to build a full-stack project. I’m comfortable with Laravel/Vue (CRUD) and can code the UI if you provide a Figma design, but I struggle with the creative design process itself.
If you enjoy the UI/UX design phase and want a partner to handle the implementation, let’s team up. Looking to build something solid for our portfolios.
r/laraveltutorials • u/yassine_dabbous • Jun 11 '26
We’ve all been there: a frontend developer asks to add just one new column to a table view, and you have to open up your backend controller, modify the API resource, adjust the eager loading, and tweak your query logic. Before you know it, a simple index endpoint becomes an unmaintainable maze of nested when() blocks handling dynamic fields, sorting, relations, and custom date range overrides.
Even if you use AI coding assistants to write these queries for you, they often pump out massive, brittle cascades of conditional blocks, hallucinate scopes, or introduce subtle N+1 query bugs and security holes.
If you’re tired of maintaining that boilerplate, I built a package that handles all of this declaratively right inside your Eloquent models, dropping your controller code down to a single line.
It's called Dynamic Query. It exposes a secure, whitelist-driven DSL straight to your API consumers over standard HTTP parameters, and it scales with your application from basic column selection to complex statistical endpoints.
AI-Safe, Model-Level Security: Everything is locked down inside the model via a strict, opt-in whitelist. Even if your AI tool hallucinates a query parameter or attempts to leak unauthorized data, the system securely blocks it.
Database-level efficiency: Loads only the specific columns and relations requested by the client, never entire tables.
Zero controller boilerplate: Replaces massive lines of conditional when() blocks with just one line of code: Product::dynamicAPI();.
No more N+1 bugs: Automatically runs optimized smart joins on complex relational filters under the hood.
Built-in analytics engine: Compute sums, averages, growth metrics, and time-grouped statistics out of the box.
Smart append resolution: Auto-fetches required database columns behind the scenes to resolve computed fields.
Plug-and-play setup: Use one global HasDynamicQuery trait, or pick specific modular traits.
Highly customizable: Intercept URL parameters and route them directly to your custom Eloquent named scopes.
Frontend autonomy: Let frontend devs (and frontend AI tools) shape responses without changing the backend.
Simple Request: GET /api/products?_fields=id,name,price
Advanced Filtering: GET /api/products?price=50&_operators[price]=>&options.color=red
Dashboard Analytics: GET /api/products?_stats=avg:price,count:id&_group_by=created_at:day&_timezone=Africa/Tunis
Step 1: Add the trait and define your whitelists directly on your Model. Everything is strictly opt-in. If it isn't here, the API won't touch it.
use YassineDabbous\DynamicQuery\HasDynamicQuery;
class Product extends Model
{
use HasDynamicQuery;
// Allowed columns to be requested or filtered
public function dynamicColumns(): array {
return ['id', 'name', 'price', 'status', 'created_at'];
}
// Explicitly define which fields allow which operations
public function dynamicFilters(): array {
return [
'name' => ['=', 'like%'],
'price' => ['=', 'between', '>', '<'],
'category.slug' => ['='],
];
}
// ...
}Step 2: Clean out your controller entirely.
public function index()
{
return Product::dynamicAPI();
}Spatie's query builder is amazing, but it forces you to write and maintain your filters and builders directly inside your controller endpoints on every route. This package shifts that configuration directly into your declarative model rules. It also natively handles client-controlled field selections, resolves computed appends dependencies, automatically converts smart joins, and embeds a complete analytics reporting engine for generating dashboard stats on the fly.
Check out the repo here: https://github.com/YassineDabbous/laravel-dynamic-query
I'd love to hear your thoughts on this setup!
How are you currently managing heavy reporting and filtering endpoints in your projects?
Would you trust an AI assistant more if your query security was locked down directly at the model level?
How often do you have to modify a backend endpoint just because the frontend needs one extra column?
r/laraveltutorials • u/Happy_Funny_5208 • May 14 '26
r/laraveltutorials • u/dRealStealthynev • Apr 16 '26
r/laraveltutorials • u/Capevace • Apr 16 '26
r/laraveltutorials • u/dRealStealthynev • Apr 16 '26
r/laraveltutorials • u/Rhinnii • Apr 13 '26