当前位置: 首页>>代码示例>>PHP>>正文


PHP Redirect::route方法代码示例

本文整理汇总了PHP中Redirect::route方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirect::route方法的具体用法?PHP Redirect::route怎么用?PHP Redirect::route使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Redirect的用法示例。


在下文中一共展示了Redirect::route方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $taxi = Taxi::findOrFail($id);
     $taxi->fill($request->all());
     $taxi->save();
     return \Redirect::route('taxis.index');
 }
开发者ID:gkreer,项目名称:smgt,代码行数:14,代码来源:TaxiController.php

示例2: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $input = Input::all();
     if ($this->post->fill($input)->validate_post()) {
         $image = Input::file('attachment');
         if ($image->isValid()) {
             $path = 'uploads/posts/' . Auth::user()->username;
             $filename = 'posts-' . time() . rand(1000, 9999) . '.' . $image->getClientOriginalExtension();
             if ($image->move($path, $filename)) {
                 $data = $this->post->create(['user_id' => Auth::user()->id, 'title' => $input['title'], 'content' => $input['content'], 'attachment' => $filename]);
                 if ($data->id) {
                     $post = $this->post->find($data->id);
                     $post->tags()->attach($input['tags']);
                     Session::flash('type', 'success');
                     Session::flash('message', 'Post Created');
                     return Redirect::route('post.index');
                 } else {
                     Session::flash('type', 'error');
                     Session::flash('message', 'Error!!! Cannot create post');
                     return Redirect::back()->withInput();
                 }
             } else {
                 Session::flash('type', 'error');
                 Session::flash('message', 'Error!!! File cannot be uploaded');
                 return Redirect::back()->withInput();
             }
         } else {
             Session::flash('type', 'error');
             Session::flash('message', 'Error!!! File is not valid');
             return Redirect::back()->withInput();
         }
     } else {
         return Redirect::back()->withInput()->withErrors($this->post->errors);
     }
 }
开发者ID:jnahian,项目名称:LV-BLOG,代码行数:40,代码来源:PostController.php

示例3: update

 public function update($id)
 {
     $validator = Validator::make(array('slider' => Input::file('slider')), array("slider" => "image | mimes:jpeg, jpg, png, gif | max: 6000"), array('mimes' => '<span class="glyphicon glyphicon-remove"></span> Unknown file inserted', 'size' => '<span class="glyphicon glyphicon-exclamation-sign"></span> Size must be less than 6 MB'));
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     } else {
         if (Input::file('slider') != '') {
             $file = Input::file('slider');
             $name = date('i-G-Y') . $file->getClientOriginalName();
             $destination = 'assets/images/slider/';
             $file->move($destination, $name);
             $query = Slider::find($id);
             $query->slider = 'assets/images/slider/' . $name;
             $query->slider_text = Input::get('text');
             if ($query->save()) {
                 return Redirect::route('slider-page')->with('event', '<p class="alert alert-success"><span class="glyphicon glyphicon-ok"></span> Slider updated successfully</p>');
             } else {
                 return Redirect::back()->with('event', '<p class="alert alert-danger"><span class="glyphicon glyphicon-remove"></span> Error occured. Please try after sometime</p>');
             }
         } else {
             $query = Slider::find($id);
             $query->slider_text = Input::get('text');
             if ($query->save()) {
                 return Redirect::route('slider-page')->with('event', '<p class="alert alert-success"><span class="glyphicon glyphicon-ok"></span> Slider updated successfully</p>');
             } else {
                 return Redirect::back()->with('event', '<p class="alert alert-danger"><span class="glyphicon glyphicon-remove"></span> Error occured. Please try after sometime</p>');
             }
         }
     }
 }
开发者ID:jorzhikgit,项目名称:MLM-Nexus,代码行数:30,代码来源:SliderController.php

示例4: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $fob = KeyFob::findOrFail($id);
     $fob->markLost();
     \Notification::success("Key Fob marked as lost/broken");
     return \Redirect::route('account.show', $fob->user_id);
 }
开发者ID:adamstrawson,项目名称:BBMembershipSystem,代码行数:13,代码来源:KeyFobController.php

示例5: addComment

 public function addComment($groupId)
 {
     $input = \Input::all();
     $input['group_id'] = $groupId;
     CustomerGroupComment::create($input);
     return \Redirect::route('customer-groups.members', $groupId);
 }
开发者ID:bengitiger,项目名称:cleverup-crm-laravel5,代码行数:7,代码来源:CustomerGroupCommentController.php

示例6: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CreateEstudianteReqest $request)
 {
     $Est = new Estudiante($request->all());
     $Est->estado = 'A';
     $Est->save();
     return \Redirect::route('estudiantes.index');
 }
开发者ID:guillospy92,项目名称:coll,代码行数:12,代码来源:EstudianteController.php

示例7: destroyList

 /**
  * Removes all local galleries for the current user list.
  *
  * @return Response
  */
 public function destroyList()
 {
     $users = Input::get('users');
     $userIds = array_pluck($users, 'id');
     $removed = $this->gallery->destroyByUsers($userIds);
     return Redirect::route('users.index')->with('message', "Has been removed {$removed} galleries");
 }
开发者ID:estebanmatias92,项目名称:pull-automatically-galleries,代码行数:12,代码来源:GalleryController.php

示例8: register

 /**
  * POST /register
  *
  * @return \View
  * @throws \Report\Managers\ValidationException
  */
 public function register()
 {
     $manager = new RegisterManager($this->userRepo->newUser(), Input::all());
     $manager->save();
     Session::flash('message', 'register-sucess');
     return Redirect::route('sing-in');
 }
开发者ID:iscnorena,项目名称:report,代码行数:13,代码来源:UserController.php

示例9: getDeactivateApiKey

 public function getDeactivateApiKey($key)
 {
     $apiKey = \App\Models\ApiKey::find($key);
     $apiKey->active = 0;
     $apiKey->save();
     return \Redirect::route('settings.apiKeys.list');
 }
开发者ID:joshhudnall,项目名称:beancounter,代码行数:7,代码来源:SettingsController.php

示例10: store

 public function store()
 {
     if ($_POST) {
         $input = Input::all();
         $rules = array('username' => 'required|unique:users', 'password' => 'required', 'email' => 'required|unique:users|email', 'firstname' => 'required|Alpha', 'lastname' => 'required|alpha_dash', 'city' => 'required', 'country' => 'required|Alpha', 'recaptcha_response_field' => 'required|recaptcha');
         $validator = Validator::make($input, $rules);
         if ($validator->fails()) {
             return Redirect::to('register')->withInput()->withErrors($validator);
         } else {
             $user = new User();
             $user->username = Input::get('username');
             $user->password = Hash::make(Input::get('password'));
             $user->firstname = Input::get('firstname');
             $user->lastname = Input::get('lastname');
             $user->email = Input::get('email');
             $user->city = Input::get('city');
             $user->country = Input::get('country');
             $user->organisation = Input::get('organisation');
             $user->description = Input::get('description');
             $user->picture = '';
             $user->suspended = 0;
             if (Input::hasFile('picture')) {
                 $file = Input::file('picture');
                 $pixpath = '/uploads/pix/user/';
                 $destinationPath = public_path() . $pixpath;
                 $filename = $user->username . '.' . $file->getClientOriginalExtension();
                 $file->move($destinationPath, $filename);
                 $user->picture = base64_encode($pixpath . $filename);
             }
             $user->save();
             return Redirect::to('login')->with('successmessage', trans('master.registersuccess'));
         }
     }
     return Redirect::route('register.index')->withInput()->withErrors($s->errors());
 }
开发者ID:RHoKAustralia,项目名称:onaroll21_backend,代码行数:35,代码来源:RegisterController.php

示例11: removeNews

 public function removeNews($id)
 {
     $news = News::find($id);
     $name = $news->title;
     $news->delete();
     return Redirect::route('account')->with('status', 'alert-success')->with('global', 'You just deleted ' . $name);
 }
开发者ID:mlauren,项目名称:midway-gallery,代码行数:7,代码来源:NewsController.php

示例12: create

 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create($username)
 {
     if (credentialsMatch($username)) {
         return View::make('posts.create', ['categories' => $this->categories]);
     }
     return Redirect::route('login');
 }
开发者ID:ChoiceParalysis,项目名称:Larablog,代码行数:12,代码来源:PostController.php

示例13: login

 /**
  *
  * @return nothing
  * @author Tremor
  */
 public function login()
 {
     if (Request::isMethod('post')) {
         $post = Input::all();
         $rules = ['email' => 'required|email', 'password' => 'required'];
         $validator = Validator::make($post, $rules);
         if ($validator->fails()) {
             $this->setMessage($validator->messages()->all(), 'error');
             return Redirect::route('login')->withInput();
         } else {
             $email = trim(Input::get('email'));
             $password = trim(Input::get('password'));
             $remember = Input::get('remember') == 1 ? true : false;
             if (Auth::attempt(array('email' => $email, 'password' => $password, 'is_admin' => 1))) {
                 return Redirect::route('admin');
             } elseif (Auth::attempt(array('email' => $email, 'password' => $password))) {
                 return Redirect::route('home');
             } else {
                 $this->setMessage('failed login', 'error');
                 return Redirect::route('login')->withInput();
             }
         }
     }
     return View::make('auth.signin')->with($this->data);
 }
开发者ID:tremor-od,项目名称:pizza.loc,代码行数:30,代码来源:AuthController.php

示例14: idpAuthorize

 /**
  * Setup authorization based on returned server variables
  * from the IdP.
  */
 public function idpAuthorize()
 {
     $email = $this->getServerVariable(config('shibboleth.idp_login_email'));
     $first_name = $this->getServerVariable(config('shibboleth.idp_login_first'));
     $last_name = $this->getServerVariable(config('shibboleth.idp_login_last'));
     $password = str_random(100);
     if ($email) {
         $credentials = ['email' => $email];
         $user = Sentinel::findByCredentials($credentials);
         if ($user) {
             Sentinel::login($user);
         } else {
             // unable to find user, so now we check to see if new users are allowed to be added
             if (config('shibboleth.add_new_users', true)) {
                 // Add New user
                 $params = ['email' => $email, 'password' => $password, 'first_name' => $first_name, 'last_name' => $last_name];
                 $user = Sentinel::registerAndActivate($params);
                 // User starts as role: standard user
                 $account_type = 1;
                 // Find the role using the role name
                 $role = Sentinel::findRoleById($account_type);
                 // Assign the role to the users
                 $role->users()->attach($user);
                 Session::put('auth_type', 'idp');
                 return \Redirect::route('manage.posts.index')->with('success', 'User (and password) has been created successfully!');
             }
             return \Redirect::route('home')->with('warning', 'We are not accepting new users at this time');
         }
         Session::put('auth_type', 'idp');
         return $this->viewOrRedirect(config('shibboleth.shibboleth_authenticated'));
     } else {
         return $this->viewOrRedirect(config('shibboleth.login_fail'));
     }
 }
开发者ID:mycrazydog,项目名称:mm-shibboleth,代码行数:38,代码来源:ShibbolethController.php

示例15: store

 /**
  * Store a newly created client in storage.
  *
  * @return Response
  */
 public function store($bookingId)
 {
     $user = Auth::user();
     $validator = Validator::make($data = Input::all(), Client::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $data['booking_id'] = $bookingId;
     if ($bookingdata = Client::create($data)) {
         $booking = Booking::getBookingData($bookingdata->booking_id);
         $pdf = PDF::loadView('emails/booking', array('booking' => $booking));
         $pdf->save(public_path() . '/temp-files/booking' . $booking->id . '.pdf');
         $emails = array('tharinda@exotic-intl.com', 'lahiru@exotic-intl.com', 'umesh@exotic-intl.com');
         $ehi_users = User::getEhiUsers();
         Mail::send('emails/booking-mail', array('booking' => Booking::getBookingData($booking->id)), function ($message) use($booking, $emails, $ehi_users) {
             $message->attach(public_path() . '/temp-files/booking' . $booking->id . '.pdf')->subject('Amended Booking(Client Added): ' . $booking->reference_number)->from('noreply@srilankahotels.com', 'SriLankaHotels.Travel')->bcc('admin@srilankahotels.travel', 'Admin');
             foreach ($emails as $emailaddress) {
                 $message->to($emailaddress, 'Admin');
             }
             if (!empty($ehi_users)) {
                 foreach ($ehi_users as $ehi_user) {
                     $message->to($ehi_user->email, $ehi_user->first_name);
                 }
             }
         });
     }
     return Redirect::route('bookings.show', $bookingId);
 }
开发者ID:tharindarodrigo,项目名称:agent,代码行数:33,代码来源:ClientsController.php


注:本文中的Redirect::route方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。