Support the ongoing development of Laravel.io →
Configuration
Last updated 2 years ago.
0

Show your code? hide the pw obviously ?

Last updated 2 years ago.
0

You can see my code here: http://laravel.io/bin/061Xr

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

use Illuminate\Database\Eloquent; $db =Settings::get();

I have this in my app.php but still get a Class 'Eloquent' not found

Last updated 2 years ago.
0

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

Last updated 2 years ago.
0

Hello

I forgot to mention, I tried in in the model and was getting: Class 'Illuminate\Database\Eloquent' not found

Last updated 2 years ago.
0

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

Last updated 2 years ago.
0

This is what I use : http://laravel.io/bin/rYjMQ

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

troiano86 troiano86 Joined 2 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.