관리-도구
편집 파일: Providers.tar
EventServiceProvider.php 0000604 00000001124 15224601117 0011363 0 ustar 00 <?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', ], ]; /** * Register any events for your application. * * @return void */ public function boot() { parent::boot(); // } } ViewComposers/SizeComposer.php 0000604 00000013053 15224601117 0012501 0 ustar 00 <?php namespace App\Providers\ViewComposers; use Illuminate\Contracts\View\View; use App\Catalogs; use App\Artist; use App\Picture; use App\Size; use Auth; use App\Libs\Sum; class SizeComposer { public function compose(View $view) { $type = (isset($_COOKIE['type'])) ? $_COOKIE['type'] : ''; $ip = $_SERVER['REMOTE_ADDR']; $pic = Picture::where('type', $type)->orderBy('id', 'DESC')->first(); $cookie_picture = $pic; if (!Auth::guest()) { $user_id = Auth::user()->id; } if (is_null($pic)) { $cookie_picture = new Picture; $cookie_picture->picture = 'uploader/1502341206-realism.jpg'; } if (isset($_GET['lang'])) { $lang = $_GET['lang']; } else { if (isset($_COOKIE['lang'])) { $lang = $_COOKIE['lang']; } else { $lang = 'Fra'; } } if (isset($_GET['width_m'])) { $width = $_GET['width_m']; } elseif (isset($_GET['width'])) { $width = $_GET['width']; } else { if (isset($_COOKIE['width'])) { $width = $_COOKIE['width']; } else { $width = 1; } } if (isset($_GET['height_m'])) { $height = $_GET['height_m']; } elseif (isset($_GET['height'])) { $height = $_GET['height']; } else { if (isset($_COOKIE['height'])) { $height = $_COOKIE['height']; } else { $height = 1; } } if (isset($_GET['catalogs_id'])) { $cat_id = $_GET['catalogs_id']; } else { if (isset($_COOKIE['catalogs_id'])) { $cat_id = $_COOKIE['catalogs_id']; } else { $cat_id = 0; } } if (isset($_GET['service_id'])) { $service_id = $_GET['service_id']; } else { if (isset($_COOKIE['service_id'])) { $service_id = $_COOKIE['service_id']; } else { $service_id = 0; } } if (isset($_GET['saloon_id'])) { $saloon_id = $_GET['saloon_id']; } else { if (isset($_COOKIE['saloon_id'])) { $saloon_id = $_COOKIE['saloon_id']; } else { $saloon_id = 0; } } if (isset($_GET['artist_id'])) { $artist_id = $_GET['artist_id']; } else { if (isset($_COOKIE['artist_id'])) { $artist_id = $_COOKIE['artist_id']; } else { $artist_id = 0; } } $artist = Artist::find($artist_id); if ($artist) { $im = explode(',', $artist->categories); $catalogs_arts = Catalogs::where('showhide', 'show')->whereIn('id', $im)->orderBy('type')->get(); } else { $catalogs_arts = null; } $catalogs = Catalogs::where('showhide', 'show')->orderBy('interval')->get(); $cookie_cat = Catalogs::find($cat_id); $size_tattoo = (int)($width * $height); $pr = 0; if (isset($cookie_cat)) { $sum = new Sum; $size = $sum->getPrice($width, $height); // dd($size, $width, $height); $real_s = Size::where('catalogs_id', $cat_id)->where('size', $size)->first(); if (isset($real_s)) { $pr = $real_s->price; } else { $pr = 0; } if ($width == 0) { $width = 1; } if ($height == 0) { $height = 1; } $sd = \App::make('\App\Libs\Sum')->getPrice($width, $height); $cookie_price = Size::where('size', $sd)->where('catalogs_id', $cookie_cat->id)->first(); $p = $cookie_price->price; $h = ceil($p / 80) / 2; // dd($sd, $cookie_price->price, $h, $cat_id, $width, $height); if ($h > 4) { $h = 4; } $catalog_id = $cookie_cat->id; } else { $cookie_price = new Size; $h = 0; $catalog_id = 0; } $price = $cookie_price; if (isset($_GET['user_id'])) { $cookie_user_id = $_GET['user_id']; } else { $cookie_user_id = 0; } $pp = $cookie_picture->picture; if (file_exists($pp)) { $imagesize = getimagesize($pp); $image_width = (int)($imagesize[0] / 38); $image_height = (int)($imagesize[1] / 38); } else { $image_width = 3; $image_height = 3; } $view->with('lang', $lang) ->with('width', $width) ->with('height', $height) ->with('size_tattoo', $size_tattoo) ->with('service_id', $service_id) ->with('saloon_id', $saloon_id) ->with('artist_id', $artist_id) ->with('catalog_id', $catalog_id) ->with('catalogs', $catalogs) ->with('catalogs_arts', $catalogs_arts) ->with('cat_id', $cat_id) ->with('h', $h) ->with('pr', $pr) ->with('price', $price) ->with('cookie_picture', $cookie_picture) ->with('pic_class', 'uploader') ->with('pp', $pp) ->with('image_width', $image_width) ->with('image_height', $image_height) ->with('cookie_user_id', $cookie_user_id); } } ViewComposers/ManagerComposer.php 0000604 00000002100 15224601117 0013130 0 ustar 00 <?php namespace App\Providers\ViewComposers; use Illuminate\Contracts\View\View; use App\Catalogs; use App\Saloon; use App\Artist; use Auth; class ManagerComposer { public function compose(View $view) { $ur = url()->full(); $arr = explode('/', $ur); $end = end($arr); if(isset($arr[4])){ $link = $arr[4]; }else{ $link = 'artist'; } $catalogs = Catalogs::all(); $saloons = Saloon::all(); $saloon = Saloon::where('manager_id', Auth::user()->id)->first(); if(isset($saloon->id)){ $artists = Artist::where('saloon_id', $saloon->id)->whereNotNull('categories')->where('showhide','show')->get(); }else{ $saloon = Saloon::query()->first(); $artists = Artist::whereNull('categories')->where('showhide','show')->get(); } $view->with('end', $end)->with('catalogs', $catalogs)->with('saloons', $saloons)->with('saloon', $saloon)->with('link', $link)->with('artists', $artists); } } SizeServiceProvider.php 0000604 00000001151 15224601117 0011214 0 ustar 00 <?php namespace App\Providers; use View; use Illuminate\Support\ServiceProvider; use App\Providers\ViewComposers\SizeComposer; class SizeServiceProvider extends ServiceProvider { /** * Bootstrap the application services. * * @return void */ public function boot() { View::composer('*', 'App\Providers\ViewComposers\SizeComposer'); View::composer('manager.*', 'App\Providers\ViewComposers\ManagerComposer'); } /** * Register the application services. * * @return void */ public function register() { //echo "ok"; } } AppServiceProvider.php 0000604 00000002060 15224601117 0011022 0 ustar 00 <?php namespace App\Providers; use Illuminate\Support\ServiceProvider; use App; use Illuminate\Support\Facades\URL; class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot() { if (isset($_GET['lang'])) { $lang = $_GET['lang']; } else { if(isset($_COOKIE['lang'])){ $lang = $_COOKIE['lang']; }else{ $lang = 'Fra'; } } $loc = 'fr'; switch ($lang) { case 'Fra': $loc = 'fr'; break; case 'Eng': $loc = "en"; break; case 'Rus': $loc = "ru"; break; } //URL::forceScheme('https'); App::setLocale($loc); } /** * Register any application services. * * @return void */ public function register() { $this->app['url']->forceScheme('https'); } } RouteServiceProvider.php 0000604 00000002771 15224601117 0011411 0 ustar 00 <?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')); } } BroadcastServiceProvider.php 0000604 00000000574 15224601117 0012214 0 ustar 00 <?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'); } } AuthServiceProvider.php 0000604 00000001077 15224601117 0011212 0 ustar 00 <?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(); // } }