내가 좋아할 만한 콘텐츠
I often see DB::raw being used for subselects, but you can do them in query builder using a closure as the 2nd argument on the where clause.

Need multiple paginators? Just pass a name as the 3rd argument of paginate method. This gets used in querystring. 2nd param is for select

In blade {{$collection->total()}} displays number of records in the whole collection {{$collection->count()}} only gives paginated amount.
When defining relationships, add ->select to slim down what's selected from the relevant table, otherwise Laravel will default to SELECT *

Mysql generated columns allow you to create columns based on your data and complex sql expressions, as always laravel as you covered.

When deploying you can speed up your app by running 'php artisan optimize' as a post deploy step.

In a migration, if you want to start incrementing from a number other than 1 use DB::update('ALTER TABLE tablename AUTO_INCREMENT = 1000');

Watch out for SQL injection issues when using DB::raw, use ? or :named placeholders, One gotcha! Variables are argument on select not raw

If you want to union more than 2 queries in query builder, fluently chain multiple ->union() calls in the final part of your query.

You can create custom messages on your own formRequest objects by adding a messages() method.

Want to get 3 random rows from a table try $RandomProducts = Products::orderByRaw('RAND()')->take(3)->get();
To edit the default Blade files for password resets etc, php artisan vendor:publish will copy the relevant templates to your resources dir
When using whereMonth in an eloquent query, you probably want to also use whereYear otherwise data from all years will be returned
Reset all migrations and reseed your database with one artisan command php artisan migrate:refresh --seed
United States 트렌드
- 1. Chauncey Billups 44.7K posts
- 2. Chauncey Billups 44.7K posts
- 3. Mafia 84.8K posts
- 4. #7_years_with_ATEEZ 50.1K posts
- 5. Damon Jones 10.1K posts
- 6. Toronto Rangers 1,710 posts
- 7. #A_TO_Z 39.5K posts
- 8. #에이티즈_7주년_항해는_계속된다 39.5K posts
- 9. 5sos 28.5K posts
- 10. Gilbert Arenas 3,777 posts
- 11. Kash Patel 32.1K posts
- 12. Kirby Air Riders 6,043 posts
- 13. The FBI 128K posts
- 14. Adam Silver 3,778 posts
- 15. The NBA 172K posts
- 16. Feds 21.2K posts
- 17. Gambling 97.6K posts
- 18. Sakurai 9,555 posts
- 19. La Cosa Nostra 3,456 posts
- 20. Poker 27.2K posts
내가 좋아할 만한 콘텐츠
-
Larajobs
@laraveljobs -
Laravel News Links
@LaravelLinks -
Bobby Bouwmann
@bobbybouwmann -
The Laravel Podcast
@LaravelPodcast -
LaraconIN
@LaraconIN -
Laracon EU
@LaraconEU -
Laracon AU
@LaraconAU -
MadeWithLaravel
@MadeWithLaravel -
Larachat Slack
@larachatslack -
Stefan Bauer
@stefanbauerme -
Laracasts
@laracasts -
nunomaduro
@enunomaduro -
Caleb Porzio ⚡️
@calebporzio -
Laravel Idea
@laravel_idea -
Mahmoud Zalt
@Mahmoud_Zalt
Something went wrong.
Something went wrong.