Laravel Pro Tips
#strings
🔥Laravel squish() Method: The 𝘀𝗾𝘂𝗶𝘀𝗵 method removes all unnecessary white space from a string, including unnecessary white space between words. #Laravel See how you can use it in your application 👇
LaraShout
#authentication #middleware
How to implement multi-login redirections in @laravelphp, you can use middleware to check the user's role and redirect them to the appropriate page #Laravel #laravelphp
Marouan Afkir
#admin #middleware
#Laravel Tip: If your user only has a role of admin or user, you can create a column of 'is_admin' (boolean type) in the users table and create a custom middleware to check if user is admin or not.
andywong31
#http #guzzle
Need to know the transfer time of a HTTP post in #Laravel or Guzzle? Use this method to get that info!
Braunson Yager
#artisan
#Laravel artisan:tinker Tip 🔥 searching for an old artisan:tinker line? Just type `history` and grab from the list 🚀
Phonosheet
#eloquent #database
#Laravel Tip: Queries that need to examine string columns will always be slower than integer columns (even when indexed). Therefore, when storing data, consider whether you need to keep the string representation... 👇 example in link below
Matt Kingshott
#eloquent #security #sql
🔥 Laravel tip: Remember to use bindings in your raw queries. You can pass an array of bindings to most raw query methods to avoid SQL injection. #php #laravel #sql #AI #Java #javascript #100DaysOfCode #learning #web3 #webdevelopment #freelancer #مطور_ويب
Thaer Fayyad | مطور ويب
#eloquent #eager loading
🔥 #Laravel Tip: Eager-loading your data is a very important, but don’t forget to add constraints to your eager loading queries so that they don’t pull in lots of data that you don’t need.
#eloquent #models
🔥 #Laravel Tip: Knowing the difference between calling ‘fresh’ or ‘refresh’ on a model is quite important. If you’re new to the framework, then here’s a simple explanation on how they differ.