0
votes

How can I debug this error guys? This is the only error message I got in my terminal. This is existing project. I just clone this and tried to run it but encounter this issue.

error:- enter image description here

APP_NAME=PalletConnect
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=magento2
DB_USERNAME=root
DB_PASSWORD=password
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

Here's the error log

[2020-10-11 02:25:48] local.ERROR: Call to a member function connection() on null {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Call to a member function connection() on null at /home/dc/Documents/Projects/PalletConnect/Warehouse%20Management%20Systems%20%28WMS%29/v1/api_v2/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1253) [stacktrace]

1
Try to set up your .env with credential of database. do you already set up it?Sok Chanty
@SokChanty already done that..here's my .envDaniel_C
Can you check with log?Sok Chanty
where can i check it again? is it in /var/log?Daniel_C
@SokChanty added the error log.Daniel_C

1 Answers

0
votes

Try to remember these steps and implement them step by step when you change the .env file.

  1. Make sure to add database credentials in .env.
  2. If you use Laravel's built-in server, I mean by the php artisan serve command, If you change your .env while the PHP server is running it's not gonna use the changed setting of the .env file until you disconnect the server once and run it again. Laravel reads the .env file once when it starts to run the PHP server. So any change during the server's running state may not affect the config setting until you rerun the PHP server.
  3. If none of the above doesn't help you, Run php artisan config:clear once; To clear the config cache just in case of unwanted caching.