Laravel will not use its database connection if it isn't needed. Where are you using database connection? Can you please share the error logs.
Create a totally empty project with laravel new
Hello guys , i decided to switch to Laravel and PHP.
And i hope you can give me some support as i will be needing a lot
I think i managed to install LAMP environment(Linux Apache MySql Php) correctly now the only problem is that when i create a new laravel project with the command laravel new , it has so many pre-configuration like it tries to connect to a MySql Database and therefore get an error when i visit the page (it dosent have an account on the db).
I don't want that, i want to create an empty Laravel skeletton project without any connection to database ....i will make that later as i'm learning.
I was wandering if there is an option to give to the laravel new command to make an empty project.
By the way creating a project with composer works fine , yet i was wandering is there a difference creating a project with composer or with the laravel installer?
@xprogrammerx to create a laravel 11 app, with the default sqlite db driver:
- make sure your dev environment php.ini has the pdo_sqlite & sqlite3 extensions enabled
- run
composer create-project laravel/laravel example-app - in the .env, change the sessions constant to SESSION_DRIVER=file (or keep it as is, but you would need to run migrate)
If you want to disable the database all together:
- run
composer create-project laravel/laravel example-app - in the .env, change the sessions constant to SESSION_DRIVER=file
- in the .env, change the db constant to DB_CONNECTION=null
Please or to participate in this conversation.