1

I try using Eloquent in routes.php, but I got a message:

InvalidArgumentException 
Database [bootstrap] not configured.

My code is below:

$shop = Shop::where('pid', '1')->first();

Please help me. Thank you very much.

1 Answer 1

1

Seems like you missed configuring the database correctly.

Assuming you are on Laravel 4.0 / 4.1 / 4.2, and that you have already setup your database, go to:

app/config/database.php

and check there if you have correct credentials.

Alternative: Maybe you are using the enviroment settings, in that case, check for the database.php files in the directory inside of app/config that corresponds to your current enviroment.

Sign up to request clarification or add additional context in comments.

2 Comments

I configured database correctly. When I try remove: $shop = Shop::where('pid', '1')->first();. Everything will be OK :(.
What laravel version are you using? Can you plz link the database schema also.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.