Latest Premium Tutorial
-
· 20 mins, 3984 words · premium
Laravel Database Structure: 11 Mistakes Developers Make
In Laravel projects, a lot of issues come from non-Laravel mistakes, database structure is one of those. In this tutorial, we will cover the most typical mistakes devs make when structuring DB in Laravel.
Newest content
-
· 3 mins, 416 words
PHP Exceptions: Laravel Package Example
-
· 2 mins, 257 words
Filament: How to Change Background of Login Page? (or any page)
-
Random Quick Laravel Tip:
Use Redis to track page viewsTracking something like page views with MySQL can be quite a performance hit when dealing with high traffic. Redis is much better at this. You can use Redis and a scheduled command to keep MySQL in sync on a fixed interval.
Route::get('{project:slug', function (Project $project) {// Instead of $project->increment('views') we use Redis// We group the views by the project idRedis::hincrby('project-views', $project->id, 1);})// Console/Kernel.php$schedule->command(UpdateProjectViews::class)->daily();// Console/Commands/UpdateProjectViews.php// Get all views from our Redis instance$views = Redis::hgetall('project-views');/*[(id) => (views)1 => 213,2 => 100,3 => 341]*/// Loop through all project viewsforeach ($views as $projectId => $projectViews) {// Increment the project views on our MySQL tableProject::find($projectId)->increment('views', $projectViews);}// Delete all the views from our Redis instanceRedis::del('project-views');Tip given by @Philo01
-
· 25 mins, 4879 words · premium
Filament: Stripe One-Time Payment Form with Elements
-
· 2 mins, 257 words
Black Friday 2023: 40% Off ALL Laravel Daily Products
-
· 2 mins, 228 words
Filament: Table Row Action - View Modal with Infolist
-
Premium Course: [NEW] PHP for Laravel Developers
-
· 2 mins, 314 words
Filament: Input Prefix/Suffix - Dynamic Based on Other Input
-
· 4 mins, 615 words
Filament: Repeater With Live Calculations - Total Price Example
-
· 7 mins, 1396 words · premium
Laravel String Helpers: 16 Open-Source Examples
-
· 4 mins, 642 words
Filament: Excel Export and Import Examples - Two Packages
-
· 7 mins, 1212 words
Filament Activity Logs: THREE Packages [Comparison Review]