DEV Community

Morcos Gad
Morcos Gad

Posted on

Tips for Shorter Code - Laravel

I found this wonderful relatively old resource https://www.youtube.com/watch?v=NUYqjdmsIj8 that talks about some tips that will make your code short and better, and I hope that these tips will help you in your next projects.

  • Shorter @if auth()-check()

Image description

Image description

  • Shorter Auth user in Blade

Image description

Image description

  • Shorter Carbon::now()

Image description

Image description

  • Shorter Log::info() and dd()

Image description

Image description

  • Shorter abort()

Image description

  • Shorter CSRF and Method

Image description

Image description

Image description

  • Shorter Hash::make()

Image description

  • Shorter redirect()-back()

Image description

I hope you enjoyed with me and I adore you who search for everything new.

Top comments (0)