Skip to content

Commit

Permalink
Modified install command to avoid installing all views. Now views hav…
Browse files Browse the repository at this point in the history
…e vendor prefix adminlte:: so tehy can be taken from package. Only default welcome and 503 views are overwritten at project
  • Loading branch information
acacha committed Sep 17, 2016
1 parent d2f5b0a commit 68e2ede
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
13 changes: 13 additions & 0 deletions src/AdminLTE.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,19 @@ public function publicAssets()
];
}

/**
* Only views to overwrite.
*
* @return array
*/
public function viewsToOverwrite()
{
return [
ADMINLTETEMPLATE_PATH.'/resources/views/errors/503.blade.php' => resource_path('views/vendor/adminlte/errors/503.blade.php'),
ADMINLTETEMPLATE_PATH.'/resources/views/welcome.blade.php' => resource_path('views/vendor/adminlte/welcome.blade.php'),
];
}

/**
* Views copy path.
*
Expand Down
31 changes: 29 additions & 2 deletions src/Console/PublishAdminLTE.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public function handle()
$this->processOptions();
$this->publishHomeController();
$this->changeRegisterController();
$this->changeLoginController();
$this->changeForgotPasswordController();
$this->changeResetPasswordController();
$this->publishPublicAssets();
$this->publishViews();
$this->publishResourceAssets();
Expand All @@ -77,13 +80,37 @@ private function publishHomeController()
}

/**
* Install Auth controller.
* Change Auth Register controller.
*/
private function changeRegisterController()
{
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::registerController());
}

/**
* Change Auth Login controller.
*/
private function changeLoginController()
{
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::loginController());
}

/**
* Change Auth Forgot Password controller.
*/
private function changeForgotPasswordController()
{
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::forgotPasswordController());
}

/**
* Change Auth Reset Password controller.
*/
private function changeResetPasswordController()
{
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::resetPasswordController());
}

/**
* Install public assets.
*/
Expand All @@ -97,7 +124,7 @@ private function publishPublicAssets()
*/
private function publishViews()
{
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::views());
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::viewsToOverwrite());
}

/**
Expand Down

0 comments on commit 68e2ede

Please sign in to comment.