Tutorials, and demo projects with Laravel framework.
Host: Povilas Korop


Laravel Daily

Laravel tip.

You can use Eloquent `with()` or `withCount()` with condition, assigning an alias to the relationship, and then ordering by the result.

See the example in the screenshot.

- - - - -

Wanna learn more about Eloquent?

I have a 1.5-hour course on Laravel Daily: "Laravel 12 Eloquent: Expert Level"
laraveldaily.com/course/laravel-eloquent-expert?mt…

1 week ago | [YT] | 202

Laravel Daily

New in this week's Laravel release: cache failover and "deferred" queue.

Side note: as much as many developers hate Twitter/X, specifically on that platform the official announcements from the founders are made FIRST.

Original tweet by Taylor: x.com/taylorotwell/status/1980664560492376378

2 weeks ago | [YT] | 120

Laravel Daily

For full-stack Laravel, which would you more more videos about?

4 weeks ago | [YT] | 119

Laravel Daily

Laravel tip.

Need conditional task execution based on environment, time, or custom logic?

Use `when()`, `between()`, `environments()`, and other constraint methods to run tasks only when conditions are met.

Link to the docs: laravel.com/docs/12.x/scheduling#schedule-frequenc…
#practicalLaravelDocs

1 month ago | [YT] | 325

Laravel Daily

Laravel tip.

Need to validate only when a field is present but allow it to be optional?

Use the `sometimes` rule! It only validates when the field exists in the request data.

Link to the docs: laravel.com/docs/12.x/validation#validating-when-p…

#practicalLaravelDocs

1 month ago | [YT] | 250

Laravel Daily

Laravel practical example: `firstOrCreate()`.

AI generated this code (version 1) for me.

I told it there's a better way with `firstOrCreate()`

It refactored, saying "you're absolutely right".

Now we're both happy.

1 month ago | [YT] | 213

Laravel Daily

Laravel tip.
Skip writing controllers for simple redirects and static pages!

Use `Route::redirect()` for redirects and `Route::view()` for returning views directly.

Link to docs: laravel.com/docs/12.x/routing#redirect-routes

2 months ago | [YT] | 255

Laravel Daily

Laravel tip.

Need to validate route parameters format?

Use `where()` constraints with regex patterns or helper methods to ensure clean URLs and prevent invalid data from reaching your controllers.

Link to the docs: laravel.com/docs/12.x/routing#parameters-regular-e…
#practicalLaravelDocs

2 months ago | [YT] | 252

Laravel Daily

ChatGPT tip.
If you use it to plan DB structure, ask it to generate a visual PNG schema.

It does it pretty well!

2 months ago | [YT] | 215

Laravel Daily

Pest 4 browser testing.
Combined with "regular" Pest testing.

In a *Livewire component* of Laravel starter kit. With Flux.
It. Just. Works.

Wow.
Just wow.
Standing ovations for Nuno Maduro.

Video coming later this week.

2 months ago | [YT] | 177