Explore tweets tagged as #laravelTips
@codewithdary
Dary
3 years
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
Tweet media one
10
27
173
@codewithdary
Dary
2 years
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
Tweet media one
6
19
150
@codewithdary
Dary
2 years
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
Tweet media one
4
23
113
@codewithdary
Dary
3 years
Do you use Laravel Passport often? #laraveltips
Tweet media one
11
3
69
@a_libori_roch
Axel Libori Roch ๐Ÿ˜
2 months
๐Ÿ’ก 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
Tweet media one
2
4
44
@codewithdary
Dary
2 years
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
Tweet media one
6
18
110
@codewithdary
Dary
2 years
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
Tweet media one
5
4
43
@codewithdary
Dary
2 years
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
Tweet media one
3
6
43
@codewithdary
Dary
2 years
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
Tweet media one
10
4
51
@laravel_updates
Laravel Updates | Tips and Tricks
2 years
๐Ÿ”ฅ Using #Laravel Dusk You can test for JavaScript errors on a page by calling the assertSourceHas method with the </script> tag as the parameter. If the page contains any JS errors, this assertion will fail. #LaravelTips #LaravelTricks #PHP #LaravelDusk
Tweet media one
1
9
36
@a_libori_roch
Axel Libori Roch ๐Ÿ˜
4 months
๐Ÿ” The pruning() method in Laravel runs right before a Prunable model gets deleted. Perfect for cleaning up files or related data ahead of delete(). In this case, it deletes the file linked to an old Invoice. #Laravel #PHP #LaravelTips
Tweet media one
0
11
62
@chilliapple
chilliapple Limited
24 days
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
@harrisrafto
Harris Raftopoulos
7 months
New video on @laravelnews ! Learn how to use AsArrayObject and AsCollection and improve your JSON data handling! #laravel #laraveltips
Tweet media one
2
12
43
@laravelnews
Laravel News
5 months
Optimize Your Laravel Factories! โšก Go over the recycle method with @โ€Œharrisrafto to: ๐ŸŽฏ Reuse models across factories ๐Ÿš€ Perfect for complex test data โœจ Improve testing performance Give us a โค๏ธ if this helped, and follow for more Laravel tips! #laravel #laraveltips
0
5
58
@laravel_updates
Laravel Updates | Tips and Tricks
2 years
๐Ÿ’ก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
Tweet media one
12
60
245
@devgleb
Gleb Varganov
2 years
Did you know, that replicate method lets you create an unsaved model, enabling seamless chaining of your favourite model methods. ๐ŸŽจ For instance, effortlessly copy a model and append "(copy)" to the title for easy identification. Your models, your rules! ๐Ÿ’ป๐Ÿ”— #LaravelTips #PHP
Tweet media one
0
0
3
@AndrewNderitu__
Andy
2 months
Laravel devs, this oneโ€™s a life-saver: ๐Ÿ› ๏ธ Whatโ€™s your favorite Laravel hack? #LaravelTips #PHP #DevLife
Tweet media one
0
0
1
@SNKhan300
Sardar Nawab Khan
2 years
Make hidden attributes visible on the fly using make visible: #laravel #laraveltips
Tweet media one
Tweet media two
1
0
1
@hucenafeef
Hussain Afeef
2 years
Laravel Validator can also be used to validate command arguments. The following is a straightforward example #laravel #laravelTips #dataValidation #command
Tweet media one
0
15
60