Skip to content

Instantly share code, notes, and snippets.

@ferdiunal
Created August 18, 2015 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ferdiunal/bcf898260122cfaba828 to your computer and use it in GitHub Desktop.
Save ferdiunal/bcf898260122cfaba828 to your computer and use it in GitHub Desktop.
Laravel View location change
<?php
/***
* Move to resources/views/welcome.blade.php resources/views/default/welcome.blade.php
*/
$theme = "default";
// Admin Views
function admin_view($view, $data = [], $mergeData = []){
\View::addNamespace("admin",base_path("resources/admin"));
return \View::make("layout");
}
// Frontend
function view($view, $data = [], $mergeData = []){
\View::addNamespace("theme",base_path("resources/views/" . $default));
return \View::make("welcome");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment