0

I have an existing website running on PHP, MySQL CSS, JS and Ajax. For future projects, I would like to use the Laravel framework to create new pages or functionality to the existing website... let's say a blog, for instance. Is this possible? Is the Laravel framework compatible with an existing website that is not set up using the MVC framework? The reason is that I would like to make my work easier and more efficient and the use of a framework would be helpful. Please let me know if you need any other info, I know the question is a little broad.

Thanks, Justin

4
  • 2
    You'd be better off rewriting your site inside Laravel Commented Sep 12, 2017 at 16:24
  • I agree. Think of it as a 2.0 version of your website. Commented Sep 12, 2017 at 16:31
  • It's more easy to convert from core php to laravel then mixing laravel into your current website. Commented Sep 12, 2017 at 17:07
  • Thanks for the responses! The website is very complex with many many files each containing 500+ lines of code. So i'm not sure this will be worth it. Is it a complicated task to convert a website to Laravel? I feel like this would be a huge project Commented Sep 13, 2017 at 15:01

1 Answer 1

2

yes it's possible but of course maybe with difficulties.

you should put your web files in /views directory, convert your php files to controllers or library files and put your assets in /public directory. then you can assign routes to your controller and call it form outside of the application.

main job is put your code into controller or libraries. is it possible to split your code into separate logical units? and extract model logic (as php mvc says) from your main code.

so if you have a clean code with good design and minimum dependencies you can think more about it. this could be a good challenge if you go through it cautiously. be careful to not fail and waste your time.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the advice. I'm thinking that converting my website to Laravel may be a very daunting task as the website is very complex!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.