Explore tweets tagged as #LaravelTips
π‘ Did you know you can add multiple columns after another one in a single call with Laravel?.It's clean, elegant, and keeps your DB tidy. Thanks @PovilasKorop for the tip!.#Laravel #PHP #LaravelTips
2
4
44
Have you ever used the insertGetId() method in Laravel? It allows you to insert a new record into a table and retrieve its ID in a single query #laraveltips
10
27
173
The whereDate() method in Laravel is an advanced query builder method that can be used to filter records by a specific date or range of dates. 7 days until I release my Query Builder & Eloquent course #laraveltips
4
23
113
Use local scopes in your Laravel app to define query constraints that can be applied to any Eloquent query builder instance, instead of repeatedly performing queries. 2 days until I release my Query Builder & Eloquent course #laraveltips
6
18
111
π§ passedValidation() is the perfect spot in a Laravel Form Request to tweak data after validation but before hitting the controller. Great for merging or modifying attributes! #LaravelTips #PHP
2
5
39
Both the find() method and findOrFail() method are useful for retrieving a single record. However, they return different responses when a record is not found. Which one do you use?. 3 days until I release my Query Builder & Eloquent course #laraveltips
5
4
43
Have you ever used the withCount() method in Laravel? It allows you to retrieve a count of related records without actually loading them. 1 more day until I release my Query Builder & Eloquent course #laraveltips
6
19
150
Have you ever heard of the toSql() method? It returns the SQL query that would be executed if you ran the Eloquent query. 5 days until I release my Query Builder & Eloquent course #laraveltips
3
6
43
Laravel devs, this oneβs a life-saver: π οΈ. Whatβs your favorite Laravel hack?.#LaravelTips #PHP #DevLife
0
0
1
Do you add default attributes at the database level or the Eloquent level? Personally, I prefer the database level because it keeps the schema organized. 4 days until I release my Query Builder & Eloquent course #laraveltips
10
4
51
π‘In #Laravel You can use same Form Request class for Multiple Actions of controller by using in the match or switch case in "rules" method. #LaravelTips #LaravelTricks #PHP
12
60
245
Code smell β error β but it slows you & your team down. From long methods to tight coupling, here are 5 PHP code smells + how to fix them π§ . Got a pet peeve we missed? Drop it π.#PHPDev #CleanCode #LaravelTips #Refactoring #chilliapple
0
0
0
New video on @laravelnews ! Learn how to use AsArrayObject and AsCollection and improve your JSON data handling!. #laravel #laraveltips
2
12
43
π― Pro Laravel Validation: Mastering Conditional Field Validation! βοΈ. Unlock the power of dynamic validation rules based on field values. Elevate your skills with these real-world examples and level up your Laravel game! π. #LaravelTips #Laravel #php π―π±
4
30
119
π§ Did you know Laravel has a trait called Prunable?.It lets you easily delete old models with a single method. Perfect for keeping your DB clean!.Schedule a command and. bye clutter! #LaravelTips #PHP
1
8
40
Did you know that you could use the withDefault method to specify a default value for a related model in case there is no related model found? 6 days until I release my Query Builder & Eloquent course. #laraveltips
4
2
45
Did you know that Laravel allows you to make hidden attributes visible? I just found out this is possible. This feature may not be well-known, but it is possible to implement. #laraveltips
3
2
17
π¨ Laravel tip: Want to send notifications to a different email based on the type?.With routeNotificationForMail(), you can redirect specific notifications to custom addresses. π¨βπ©βπ§βπ¦ Parents get the truancy alerts, not the student π.#LaravelTips #PHP
0
11
39