I'm using barryvdh / laravel-elfinder . This generates the configuration file /config/elfinder.php.
Within this file, I inform the way to upload ElFinder files.
I need every user to have their upload folder. I thought of creating a $dir
variable according to the id of the logged-in user but I can not use the Auth
class inside the /config/elfinder.php
file.
Are you able to get the user logged in any other way?
The file looks like this:
<?php
$dir = 'arquivos';
return array('dir' => [$dir] );
I want something like this:
<php
$dir = 'arquivos/'.Auth::id();
return array('dir' => [$dir] );
I've tried this:
<?php
use Auth;
$id=Auth::id();
$dir = 'arquivos/'.$id;
return array('dir' => [$dir] );
And returns this error:
Warning: The use statement with non-compound name 'Auth' has no effect in /var/www/html/dna/config/elfinder.php on line 3 Fatal error: Class 'Auth' not found in /var/www/html/dna/config/elfinder.php on line 5