當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Auth::travel_company_staff方法代碼示例

本文整理匯總了PHP中Illuminate\Support\Facades\Auth::travel_company_staff方法的典型用法代碼示例。如果您正苦於以下問題:PHP Auth::travel_company_staff方法的具體用法?PHP Auth::travel_company_staff怎麽用?PHP Auth::travel_company_staff使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Support\Facades\Auth的用法示例。


在下文中一共展示了Auth::travel_company_staff方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (Auth::travel_company_staff()->get()->type != 1) {
         abort('404');
     }
     return $next($request);
 }
開發者ID:thomasdola,項目名稱:afrouteWeb,代碼行數:14,代碼來源:CompanyAdminCheck.php

示例2: store

 /**
  * Store a newly created resource in storage.
  *
  * @param Request $request
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $company_id = Auth::travel_company_staff()->get()->travel_company->id;
     $this->validate($request, ['country' => 'required', 'region' => 'required', 'city' => 'required', 'location' => 'required']);
     $request = array_add($request->all(), 'travel_company_id', $company_id);
     Station::create($request);
     return redirect()->route('company.stations.index');
 }
開發者ID:thomasdola,項目名稱:afrouteWeb,代碼行數:15,代碼來源:CompaniesStationsController.php

示例3: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (Auth::user()->get()) {
         return redirect()->route('welcome');
     } elseif (Auth::travel_company_staff()->get()) {
         return redirect()->route('company_login');
     }
     return $next($request);
 }
開發者ID:thomasdola,項目名稱:afrouteWeb,代碼行數:16,代碼來源:RedirectIfNotAdmin.php

示例4: getCompanyLogout

 /**
  * Log the user out of the application.
  *
  * @return \Illuminate\Http\Response
  */
 public function getCompanyLogout()
 {
     Auth::travel_company_staff()->logout();
     Session::flush();
     return redirect()->route('company_login');
 }
開發者ID:thomasdola,項目名稱:afrouteWeb,代碼行數:11,代碼來源:AppCompanyStaffAuthenticationController.php

示例5: profile_image

 public function profile_image(Request $request)
 {
     $travel_company = Auth::travel_company_staff()->get()->travel_company;
     $this->validate($request, ['terminal_images' => 'required']);
     $terminal_images = $request->terminal_images;
     $n_o_i = count($terminal_images);
     $destinationPath = null;
     if (App::environment() == 'local') {
         $destinationPath = base_path() . '/public/images/';
     } elseif (App::environment() == 'production') {
         $destinationPath = '/home/twokays/public_html/images/';
     }
     if (count($terminal_images) > 0) {
         for ($i = 0; $i < $n_o_i; $i++) {
             if ($terminal_images[$i]->isValid()) {
                 $img = $terminal_images[$i];
                 $file = $img;
                 $ext = $file->getClientOriginalExtension();
                 $destinationPath = $destinationPath;
                 $fileName = str_slug($travel_company->name) . '_image_' . $i . '.' . $ext;
                 $full_path = '/images/' . $fileName;
                 $file->move($destinationPath, $fileName);
                 // uploading file to given path
                 $tcl = TravelCompanyPicture::where('travel_company_id', $travel_company->id)->where('path', $full_path)->first();
                 if (!$tcl) {
                     TravelCompanyPicture::create(['path' => $full_path, 'travel_company_id' => $travel_company->id]);
                 } else {
                     $tcl->update(['path' => $full_path]);
                 }
             }
         }
     } else {
         return redirect()->back()->withErrors('Please Choose at least an image');
     }
     return redirect()->route('company_settings');
 }
開發者ID:thomasdola,項目名稱:afrouteWeb,代碼行數:36,代碼來源:CompaniesController.php

示例6: __construct

 /**
  * Create a new filter instance.
  *
  * @param  Guard  $auth
  * @return void
  */
 public function __construct()
 {
     $this->auth = Auth::travel_company_staff();
 }
開發者ID:thomasdola,項目名稱:afrouteWeb,代碼行數:10,代碼來源:RedirectCompanyIfAuthenticated.php

示例7: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param Station $station
  *
  * @param Trip $trip
  *
  * @internal param int $id
  * @return Response
  */
 public function edit(Trip $trip)
 {
     $company = Auth::travel_company_staff()->get()->travel_company;
     $stations = Station::whereraw('travel_company_id = ?', [$company->id])->get();
     return view('companies.trips.edit', ['stations' => $stations, 'trip' => $trip]);
 }
開發者ID:thomasdola,項目名稱:afrouteWeb,代碼行數:16,代碼來源:CompaniesTripsController.php


注:本文中的Illuminate\Support\Facades\Auth::travel_company_staff方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。