示例#1
0
 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param \Illuminate\Routing\Router $router
  *
  * @return void
  */
 public function boot(Router $router)
 {
     //
     parent::boot($router);
     $router->model('contact', Contact::class);
     $router->model('service', Service::class);
     $router->model('appointment', Appointment::class);
     $router->bind('business', function ($businessSlug) {
         return Business::where('slug', $businessSlug)->first();
     });
 }
示例#2
0
 /**
  * get Home.
  *
  * @param Business $business Business to display
  *
  * @return Response Rendered view for desired Business
  */
 public function getHome($slug)
 {
     logger()->info(__METHOD__);
     logger()->info(sprintf('slug:%s', $slug));
     if ($domain = Domain::where('slug', $slug)->first()) {
         return $this->getDomain($domain);
     }
     if ($business = Business::where('slug', $slug)->first()) {
         session()->set('guest.last-intended-business-home', $slug);
         return view('guest.businesses.show', compact('business'));
     }
     session()->forget('guest.last-intended-business-home');
     $baseurl = url()->to('/' . $slug);
     flash()->success(trans('app.msg.slug_is_available', compact('baseurl')));
     return redirect()->to('/auth/login');
 }
示例#3
0
 /**
  * Update business attirbutes.
  *
  * @param Business $business
  * @param array    $data
  *
  * @return Timegridio\Concierge\Models\Business
  */
 public function update(Business $business, $data)
 {
     $business->where(['id' => $business->id])->update($data);
     return $business;
 }
示例#4
0
 public function getBusiness($id, $identificator = null)
 {
     $identificator = $identificator ?: $this->identificator;
     return Business::where($identificator, $id)->first();
 }