first commit

This commit is contained in:
denisdulici
2017-09-14 22:21:00 +03:00
commit 515bdaf5cd
598 changed files with 48030 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<?php
namespace App\Providers;
use Blade;
use Illuminate\Support\ServiceProvider;
use Schema;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
// Laravel db fix
Schema::defaultStringLength(191);
// Add setting directive
Blade::directive('setting', function ($expression) {
return "<?php echo setting($expression); ?>";
});
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
if (env('APP_DEBUG')) {
$this->app->register(\Barryvdh\Debugbar\ServiceProvider::class);
}
if (env('APP_ENV') !== 'production') {
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
}
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
*
* @var array
*/
protected $policies = [
'App\Model' => 'App\Policies\ModelPolicy',
];
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
{
$this->registerPolicies();
//
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Broadcast;
class BroadcastServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Broadcast::routes();
require base_path('routes/channels.php');
}
}

View File

@@ -0,0 +1,38 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Event;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
'App\Events\Event' => [
'App\Listeners\EventListener',
],
'Illuminate\Auth\Events\Login' => [
'App\Listeners\Auth\Login',
],
'Illuminate\Auth\Events\Logout' => [
'App\Listeners\Auth\Logout',
],
];
/**
* Register any events for your application.
*
* @return void
*/
public function boot()
{
parent::boot();
//
}
}

View File

@@ -0,0 +1,68 @@
<?php
namespace App\Providers;
use Form;
use Illuminate\Support\ServiceProvider;
class FormServiceProvider extends ServiceProvider
{
/**
* Register bindings in the container.
*
* @return void
*/
public function boot()
{
// Form components
Form::component('textGroup', 'partials.form.text_group', [
'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6',
]);
Form::component('emailGroup', 'partials.form.email_group', [
'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6',
]);
Form::component('passwordGroup', 'partials.form.password_group', [
'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6',
]);
Form::component('selectGroup', 'partials.form.select_group', [
'name', 'text', 'icon', 'values', 'selected' => null, 'attributes' => ['required' => 'required'], 'col' => 'col-md-6',
]);
Form::component('textareaGroup', 'partials.form.textarea_group', [
'name', 'text', 'value' => null, 'attributes' => ['rows' => '3'], 'col' => 'col-md-12',
]);
Form::component('radioGroup', 'partials.form.radio_group', [
'name', 'text', 'enable' => trans('general.yes'), 'disable' => trans('general.no'), 'attributes' => [], 'col' => 'col-md-6',
]);
Form::component('checkboxGroup', 'partials.form.checkbox_group', [
'name', 'text', 'items' => [], 'value' => 'name', 'id' => 'id', 'attributes' => ['required' => 'required'], 'col' => 'col-md-12',
]);
Form::component('fileGroup', 'partials.form.file_group', [
'name', 'text', 'attributes' => [], 'col' => 'col-md-6',
]);
Form::component('deleteButton', 'partials.form.delete_button', [
'item', 'url', 'text' => '', 'value' => 'name', 'id' => 'id',
]);
Form::component('saveButtons', 'partials.form.save_buttons', [
'cancel', 'col' => 'col-md-12',
]);
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
}

View File

@@ -0,0 +1,31 @@
<?php
namespace App\Providers;
use App\Models\Company\Company;
use Illuminate\Support\ServiceProvider;
class ObserverServiceProvider extends ServiceProvider
{
/**
* Register bindings in the container.
*
* @return void
*/
public function boot()
{
// Observe company actions
Company::observe('App\Observers\Company');
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
}

View File

@@ -0,0 +1,73 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = 'App\Http\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
//
parent::boot();
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->mapApiRoutes();
$this->mapWebRoutes();
//
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}
}

View File

@@ -0,0 +1,52 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use View;
class ViewComposerServiceProvider extends ServiceProvider
{
/**
* Register bindings in the container.
*
* @return void
*/
public function boot()
{
// All
View::composer(
'*', 'App\Http\ViewComposers\All'
);
// Add company info to menu
View::composer(
['partials.admin.menu', 'partials.customer.menu'], 'App\Http\ViewComposers\Menu'
);
// Add notifications to header
View::composer(
['partials.admin.header', 'partials.customer.header'], 'App\Http\ViewComposers\Header'
);
// Add limits to index
View::composer(
'*.index', 'App\Http\ViewComposers\Index'
);
// Add Modules
View::composer(
'modules.*', 'App\Http\ViewComposers\Modules'
);
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
}