本文整理匯總了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);
}
示例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');
}
示例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);
}
示例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');
}
示例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');
}
示例6: __construct
/**
* Create a new filter instance.
*
* @param Guard $auth
* @return void
*/
public function __construct()
{
$this->auth = Auth::travel_company_staff();
}
示例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]);
}