REFACTORING: return / instaed of DIRECTORY_SEPARATOR in service providers
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<?php namespace Modules\ContactForm\Providers;
|
||||
|
||||
use App\Handlers\Registrators\TemplateRegistrator;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use InvalidArgumentException;
|
||||
|
||||
@@ -44,10 +43,8 @@ class ContactFormServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected function registerConfig()
|
||||
{
|
||||
$this->publishes([
|
||||
__DIR__ . DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'Config'.DIRECTORY_SEPARATOR.'config.php' => config_path('contactform.php'),
|
||||
]);
|
||||
$this->mergeConfigFrom(__DIR__ . DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'Config'.DIRECTORY_SEPARATOR.'config.php', 'contactform');
|
||||
$this->publishes([__DIR__ . '/../Config/config.php' => config_path('contactform.php')]);
|
||||
$this->mergeConfigFrom(__DIR__ . '/../Config/config.php', 'contactform');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,13 +54,13 @@ class ContactFormServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function registerViews()
|
||||
{
|
||||
$viewPath = base_path('resources'.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.'contactform');
|
||||
$sourcePath = __DIR__ . DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'views';
|
||||
$viewPath = base_path('resources/views/modules/contactform');
|
||||
$sourcePath = __DIR__ . '/../Resources/views';
|
||||
|
||||
$this->publishes([$sourcePath => $viewPath], 'module-views');
|
||||
|
||||
$this->loadViewsFrom(array_merge(array_map(function ($path) {
|
||||
return $path . DIRECTORY_SEPARATOR.'modules'.DIRECTORY_SEPARATOR.'contactform';
|
||||
return $path . '/modules/contactform';
|
||||
}, \Config::get('view.paths')), [$sourcePath]), 'contactform');
|
||||
|
||||
/**
|
||||
@@ -90,7 +87,7 @@ class ContactFormServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function registerTranslations()
|
||||
{
|
||||
$this->loadTranslationsFrom(__DIR__ . DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'lang', 'contactform');
|
||||
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'contactform');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user