I know that AngularJs is FrontEnd and Laravel is Backend but my questions is:
Why do I need to use AngularJs in the first place where everything I need is done through Laravel ?
From what I understood is that I can make an app with either langs JS or PHP, but I find lots of users use both which for me as a beginner it seems like an overkill, so could someone please explain in the simplest possible form of an answer.
What is the benefit of using both in the same project ? And how do you usually structure your app/folders
when you use both specially that both are MVC ?
I suspect the question may conflict with stackoverflow's quality guidelines and you may almost be better asking two separate questions. i.e.
For setting up the folder structure, check out these resources
http://scotch.io/tutorials/php/create-a-laravel-and-angular-single-page-comment-application https://www.youtube.com/watch?v=hqAyiqUs93c
I can only really speak to why I use laravel with angularjs and you are right that you can use laravel without angular, but the reason I use angular as well as laravel is because there are some things that javascript is just better positioned for than server side apps e.g.
So if you want your website/webapp to have those benefits you need to write the functionality in javascript. I can't say I have used all the frameworks to then say that angular is the best one, but for me angular provides an integrated suite of solutions and to a wide range of issues, on top of an architecture that seems to work well.
I think this is partly why there are quite a few new concepts to learn and the need for these components is not immediately obvious.
This may be due to the fact that a component you are using to perform some function, e.g. using a $scope object to relay data between a controller and a view, also serves a function in the bigger picture, e.g. maintaining separation between the view and the controller - which helps with organising code, testability as well as other factors.
If you use angular as well as Laravel (as opposed to just Laravel by itself) you will then have the option of giving your users these benefits, because you have more options available e.g. use laravel where it best suits the requirements of your app and users or use angular where it gives the best result - and you will have a better web app in the end.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With