for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sco\Admin\Providers;
use Illuminate\Support\ServiceProvider;
class PublishServiceProvider extends ServiceProvider
{
public function getBasePath()
return dirname(dirname(__DIR__));
}
public function boot()
if ($this->app->runningInConsole()) {
$this->publishAssets();
$this->publishConfig();
$this->publishViews();
$this->publishTranslations();
$this->publishRoutes();
public function register()
protected function publishAssets()
$this->publishes([
$this->getBasePath() . '/resources/assets' => base_path('resources/assets/vendor/admin'),
], 'assets');
protected function publishConfig()
$this->getBasePath() . '/config/' => config_path(),
], 'config');
protected function publishViews()
$this->getBasePath() . '/resources/views' => base_path('resources/views/vendor/admin'),
], 'views');
protected function publishTranslations()
$this->getBasePath() . '/resources/lang' => base_path('resources/lang/vendor/admin'),
], 'lang');
protected function publishRoutes()
$this->getBasePath() . '/routes/admin.php' => base_path('routes/admin.php'),
], 'routes');