Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

alexhackney's avatar

Static site -> Laravel with Git

I use forge for a lot. In fact I use it for static sites and wp sites in addition to laravel projects.

I've got a static site now that I'm ready to convert to a full blown laravel project.

What would be the process for moving from html pages to laravel with git?

I think I would create a new branch, install laravel, setup my basic routes and then setup the views to match the static site. Would I then merge the branch into master then deploy as usual?

0 likes
6 replies
lancebutler2's avatar
Level 11

Honestly man, if I were in your shoes I'd just install a new laravel project. Init git from there. And start to bring over your site piece by piece and integrate it into your new laravel project. If it's a static site, it won't be that complicated anyways.

alexhackney's avatar

I'm using git already for the static site. Are you recommending scrapping the first and just starting over? I guess that would be cleaner.

lancebutler2's avatar

I really don't think there's a wrong answer. And by no means do I know the scope/size of your project currently. I can only say if it were me, and I had a static site (just views), it'd be easiest for me to new up a laravel project, create the necessary controllers to render views, bring in the stylesheets & images, and one-by-one create the necessary views by copying/pasting from my old project.

Again I don't know the size/scope of things, or if you need to keep the git history. But I'd imagine your static site project is at a stable point right now. You could create the new project. Init a new git install, and away you go from there.

This is just one angle of tackling migrating a static site to a laravel project.

lancebutler2's avatar

Yes you certainly could create a new branch...and in your new branch create a composer.json file with everything necessary to install laravel. Though, in my mind, it seems like it'd be a larger headache trying to figure out what files/folder you can now delete. And which ones were created with your laravel install.

Again, no wrong answer. Depending on the size of your project currently, you could migrate a static site pretty quickly.

alexhackney's avatar

I think you're right. I do not need the history. I'll just create a new proj and then when its ready push it up in place of the existing one.

Thanks guys!

Please or to participate in this conversation.