Hosting a laravel website

Hello
3 Replies
NIMA
NIMAOP•2mo ago
im new to laravel and i make a simple crud app and i want put it in my host but the file is to heavy ist more than 100 mg what should i remove from the file so website dont break and i can still put it in host and also for the database i should just import it to the c pannel ? or i should u artisan commend
13eck
13eck•2mo ago
but the file is to heavy ist more than 100 mg
Any half-way decent host won't have a 100MB limit. Even on a free tier that sounds awful. Unless you have one large file that's over 100MB and the default uploader can't handle one single file that size. If that's the case then you should break your mega-file into smaller files that each do something important. Then upload all the files (and they'll be less than 100MB each!) to your host.
what should i remove from the file so website dont break and i can still put it in host
Anything that's not needed for it to function? You really haven't given us anything to go on so our answers are going to be vague.
and also for the database i should just import it to the c pannel ? or i should u artisan commend
C Panel should suffice (though I'm not familiar with artisan commend so 🤷 ). But your host should have some docs on how to handle the DB stuff.
Jochem
Jochem•2mo ago
(for reference, artisan is Laravel's command line tool. Kinda what npm scripts would do for a JS framework, but very very batteries included in Laravel) and yeah, seconded what Beck said, it's too vague to really answer usefully as for hosting Laravel, I'm not 100% cause I've never taken a Laravel project to production, but generally you'd take the entire project and put it on the server, then configure apache or nginx to point to the correct entry point. I'm not 100% sure, but I think most of a Laravel project is designed to live outside of the document root. As for shrinking it, if it's literally just the laravel install, I don't think it's going to be easy. You can potentially remove some installed packages, or start deleting files you don't think are in use. I'd recommend reading the Laravel docs about deployment, their docs in general are really good in my experience. If you get stuck with those, come back here and add a lot more detail to your question. Especially "the file" makes very little sense to me, Laravel is thousands of files

Did you find this page helpful?