Can you post the actual dumps please?
using enviroment variables in Laravel view doesn't work
hey,
I discovered a phenomenon in Blade that I cannot explain or handle at all.
In the store function in UsersControllers I save the directory of a user.
A directory typically looks like (BasePath)(FormRequestPath)
The Base Path is defined in my .env file. In config/app.php I also say : 'base_path' => env('BASE_PATH', '/srv/ftp'), And then I get it in my controller store function using config() and finally store there full path in my DB. All this actually works fine.
Now it starts getting weired. In my show view I want to get the full path back but when do
{{dd($user->directory)}} // prints only FormRequestPath
{{dd($user)}} // prints an object that contains a directory attribute with the full path
can you explain me what laravel exactly does there and what I am doing wrong?
Thanks Amit
Please or to participate in this conversation.