13

If I see one more Laravel dev I'mma commit a war crime
If I see one more Laravel dev dropping env(something) around the code I'mma commit _SEVERAL_ war crimes

Remember kids: you don't work with Laravel. If you do (you don't, but let's assume), ENV IS USED ONLY IN CONFIGURATION FILES, OR LARAVEL CACHING SYSTEM FUCKING BREAKS. Ok?

Comments
  • 4
    ok

    .

    .

    .

    sorry 😞
  • 3
    Just kidding, of all those words I only understood war, crime and env. I don't know shit about php
  • 5
    Plot twist: neeno starts working with Laravel after reading this rant.
  • 6
    @Lensflare I'd rather get eaten alive by cockroaches
  • 1
    I quite enjoy using Laravel. (:
  • 1
    @neeno take a long good look at this guy, he fucking gets it.
  • 0
    TIL 😳
  • 2
  • 1
    @IHateForALiving There's a reason it's at the last
  • 0
    Here's how the thing goes

    In every Laravel's project there's a top level "config" folder.

    That's pretty much what runs at the beginning of your application; here you are allowed to use env("somethingsomething") to get the values of your .env file.

    You COULD theorically use .env in other files too, and so long as you are in development, it can work.

    Thing is: accessing all those separate files is slow, you don't want that for production. Combining all those files into a single one may come in handy. That's what php artisan config:cache does for you.

    Then, you can access those config values with the Illuminate\Support\Facades\Auth facade. If you follow these steps your applications should become faster, but of course you can't use .env anymore.

    I have attached literal pics; do this thing, run "php artisan config:cache" and enjoy a better designed project.

    EDIT: devrant butchered the quality on this one, I hope it's clear what's going on anyway.
  • 0
    Aaaah, that makes sense. πŸ‘πŸΌπŸ‘πŸΌ
Add Comment