I have installed laravel onto my account. I already have a database for the php website I was previously creating and now want to use this database in my new laravel application. I think I need to configure this in the env file but dont know what needs to be changed in the env file. Also how does migration and seeding work on a hosted site (all the tutorials only show how to do this from the command line)
You can use Laravel with some effort, but it doesn’t work very nicely.
Laravel by default assumes that the webroot of your website can be changed to the public directory, and the other folders are not web accessible. You could edit the index.php file and move everything from the public, or add some good .htaccess rules to the main folder.
Another issue is that many administrative functions of Laravel require the Artisan command line tool, which you can’t use on the free hosting server.
Honestly, Laravel was not designed with a regular web hosting service in mind. It can work, but it won’t work well.
Thanks for your reply. I have been able to sort out the issue with linking to pages however I still can’t see how the mySQL database for my account can be accessed from the laravel framework which I have downloaded to my account. Do I need to write a script in a file
yes, I would like to know how to connect to the database please.
I followed a tutorial and have put the database details in the .env file. The tutorial mentions migration and seeding from the commandline.
There is already a migrate folder in the file structure and a seeding folder also which automatically created files when I downloaded Laravel so I know I dont have to do anything there but I dont know how to connect to the database when I am not using the commandline.
Thank you very much! I think it’s this part of the documentation that I need now - Running A Select Query - To run a basic query, you may use the select method on the DB facade
I think I have done the database settings part but to run a query I dont know whether to put this code in a seperate file or the main app > http > controllers > controller.php file