Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Folder structure when Lumen With Angularjs?

I would like to develop web application using Lumen and AngularJs. I have app folder which contains all angularJS files,which means client side application inside app folder.

But I found two folder for view purpose in Lumen,those are public and resource. all view files pointed out in resource folder and all assets like js,images etc are in public folder.

enter image description here

How can I bring all in to a particular location either public or resource.

Please explain is there any good practice in case of folder structure?

If I using both public and resource folder,Is it good practice?

like image 322
gsk Avatar asked Aug 23 '26 18:08

gsk


1 Answers

These folders have a different purpose. The resources folder is where your views will go. Lumen will grab these, perform any necessary functions on them, then display them.

The public folder would be a place where you put your assets (images, css, javascript, etc...). You should have this folder set as your document root in your webserver.

The views themselves which reside in resources/views should not be directly accessible by anyone on the net, the public folder should be. Although, you probably won't be using this folder much because you are using Angular so most of your html would go in the public folder to be accessed by Angular.

like image 51
user1669496 Avatar answered Aug 26 '26 09:08

user1669496



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!