Laravel 5.1 - Checking a Database Connection

前端 未结 6 1523
粉色の甜心
粉色の甜心 2020-12-13 02:10

I am trying to check if a database is connected in Laravel.

I\'ve looked around the documentation and can\'t find anything. The closest thing I\'ve found is this, bu

6条回答
  •  抹茶落季
    2020-12-13 02:10

    You can also run this:

    php artisan migrate:status
    

    It makes a db connection connection to get migrations from migrations table. It'll throw an exception if the connection fails.

提交回复
热议问题