Support the ongoing development of Laravel.io →
Configuration Views
Last updated 2 years ago.
0

I was just about to ask a similar question... :)

ricomonster said:

i wanted to create a themes folder for my mini-cms project, how can i achieve that using Laravel?

Last updated 2 years ago.
0

Not sure if this will work ok for you, but you can put your view directory anywhere and change it in app/config/view.php.

So you could do something like:

app/themes/boostrap or app/themes/foundation etc.

Then by changing the paths config in app/config/view.php you can swap between themes. This doesn't solve the issue of also needing to stick files in your public path.

Last updated 2 years ago.
0

I use themify but made some changes, move assets to theme folder Originally public/assets/theme-name/, my public/theme/assets

https://github.com/juy/themify

Last updated 2 years ago.
0

yes, i would like the concept that the themes will be placed under the public folder.

angelside said:

I use themify but made some changes, move assets to theme folder Originally public/assets/theme-name/, my public/theme/assets

https://github.com/juy/themify

^ will check this out if it will work.

Last updated 2 years ago.
0

If there will be views in your theme folder, I would not place them in the public folder. If you place them in the public folder, make sure they are not directly accessible for security reasons (opening up possible security holes).

Last updated 2 years ago.
0

Edwin-Luijten said:

If there will be views in your theme folder, I would not place them in the public folder. If you place them in the public folder, make sure they are not directly accessible for security reasons (opening up possible security holes).

any suggestions to make on how will i achieve this?

Last updated 2 years ago.
0

I have not yet tested one of these methods but you could try one from the following link: http://studentduniya.in/deny-access-of-files-and-folders-through-htaccess/

Create an htaccess file in your theme folder

<Files ~ "\blade.php$">
Order allow,deny
Deny from all
</Files>

or

Options All -Indexes
Last updated 2 years ago.
0

A simple solution is to namespace your views, so

add this in global.php

View::addNamespace('theme',  app_path() . '/themes/views');

then save your views within your themes directory e.g

/themes/views/home/index.blade.php

and call them like so

return View::make('theme::home.index')
Last updated 2 years ago.
0

thanks for the responses guys, i finally solved the problem by using this package: https://github.com/harryxu/laravel-theme

Last updated 2 years ago.
0

Views location, solved...

But what about assets locations? Is there a mechanism to relocate the assets path from 'public' to something else?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.