Esempio n. 1
0
 public function postRegister(RegisterBroadcastersRequest $request, BroadcasterServiceProvider $broadcasters)
 {
     //dd($request->all());
     \DB::transaction(function () use($request, $broadcasters) {
         $user = $this->create($request->only('email', 'password'));
         $broadcaster = $broadcasters->saveData($request->only('company_name', 'display_name'));
         $broadcaster->services()->attach($request->get('services'));
         //add services to broadcaster
     });
     return redirect(route('broadcasterLogin'));
 }
 /**
  * Register bindings in the container.
  *
  * @return void
  */
 public function boot(BroadcasterServiceProvider $broadcasterServiceProvider)
 {
     // Using class based composers...
     //View::composer('profile', 'App\Http\ViewComposers\ProfileComposer');
     // Using Closure based composers...
     View::composer(['admin/*', 'broadcaster/*'], function ($view) {
         $view->with('cbs_options', \Config::get('site'));
     });
     View::composer('broadcaster/*', function ($view) use($broadcasterServiceProvider) {
         if (\Auth::check()) {
             $view->with('cbs_services', $broadcasterServiceProvider->getBroadcasterServices());
         }
     });
 }