If you have a look at Illuminate/Foundation/start.php you'll see that the config is loaded before the aliases are set up.
The eloquent error will go away if you access the non aliased class Illuminate\Database\Eloquent
the same goes for your DB call. You'll have to call the fully qualified db class.
You also won't need to call require '../vendor/autoload.php';
as it is called automatically by bootstrap/autoload.php.
One thing to think about though is DatabaseManager won't be set up at this point and the db config won't be loaded so in order to use the database you'll have to create an instance of Illuminate\Database\Connection
yourself to use.
use Illuminate\Database\Eloquent; $db =Settings::get();
I have this in my app.php but still get a Class 'Eloquent' not found
troiano86 said:
use Illuminate\Database\Eloquent; $db =Settings::get();
I have this in my app.php but still get a Class 'Eloquent' not found
use Illuminate\Database\Eloquent
needs to be called in the Settings model
Hello
I forgot to mention, I tried in in the model and was getting: Class 'Illuminate\Database\Eloquent' not found
I gave up and went with a similar solution that met my needs.. I have a user submit the needed details and I write it into a .ini file, which is parsed and loading by the needed file in /app/config
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community