DEV Community

Morcos Gad
Morcos Gad

Posted on

5 2

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.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)