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


PHP Redirect::action方法代码示例

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


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

示例1: create

 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create(FiltroRequest $request)
 {
     // dd($request->input('menorEdad'));
     $cedula = trim($request->input('cedula'));
     if ($cedula) {
         $epa = DB::table('personas')->join('solicitudes', 'personas.id', '=', 'solicitudes.id_beneficiario')->join('usuarios_solicitudes', 'solicitudes.id', '=', 'usuarios_solicitudes.id_solicitud')->where('personas.cedula', $cedula)->orderBy('usuarios_solicitudes.estatus', 'desc')->get();
         if (count($epa) > 0) {
             if ($epa[0]->estatus == 1 || $epa[0]->estatus == 2) {
                 return redirect('filtro')->with('mensaje', 'la solicitud esta en en cola');
             } else {
                 $hoy = Carbon::now();
                 //agregamos 6 meses mas
                 $fecha_aprobada = Carbon::parse($epa[0]->fecha_registro)->addMonth(6);
                 //comprueba si la primera fecha es mayor a la segunda fecha.
                 $fecha = $hoy->gt($fecha_aprobada);
                 // Session::flash('mensaje','El beneficiario obtuvo un finaciamiento, debe esperar 6 meses');
                 //return redirect('filtro');
                 if ($fecha == true) {
                     $ci = Crypt::encrypt($cedula);
                     return redirect('solicitudes/' . $ci);
                 } else {
                     //dd(Redirect::action('SolicitudesController@show',$epa[0]->id));
                     //return redirect()->route('fichas',[$epa[0]->id]);
                     return Redirect::action('SolicitudesController@show', $epa[0]->id);
                 }
             }
         }
         $ci = Crypt::encrypt($cedula);
         return redirect('solicitudes/' . $ci);
     }
     //menor de edad sin cedula
     $ci = Crypt::encrypt(0);
     return redirect('solicitudes/' . $ci);
 }
开发者ID:robertdac,项目名称:sistema_gestion_social,代码行数:39,代码来源:FiltroController.php

示例2: logar

 public function logar(Request $request)
 {
     $regras = array('email' => 'required|string', 'password' => 'required');
     $mensagens = array('required' => 'O campo :attribute deve ser preenchido.');
     $this->validate($request, $regras, $mensagens);
     $email = $request['email'];
     $senha = $request['password'];
     $condicao = ['email' => $email];
     $remember = !empty($request['remember']) ? true : false;
     if (Auth::attempt(['email' => $email, 'password' => $senha], $remember)) {
         if ($this->authorize('logar', $email, $senha)) {
             return Redirect::action('LoginController@index');
         }
     }
     //        if(!empty($usuario) && Hash::check($senha,$usuario->password))
     //        {
     //                Auth::loginUsingId($usuario->id);
     //
     //            if($this->authorize('logar',$email,$senha))
     //            {
     //                return redirect('Empresa');
     //            }
     //        }
     return redirect()->back()->withErrors('Usuário inválido.');
 }
开发者ID:renanpupin,项目名称:brasilspot,代码行数:25,代码来源:LoginController.php

示例3: update

 /**
  * Update modified settings.
  *
  * @Post("/settings", middleware="shift.account", prefix="/")
  */
 public function update()
 {
     // TODO: Establish a method of validating settings?
     // ...
     $this->settingsService->update(Input::get());
     return Redirect::action('Tectonic\\Shift\\Controllers\\SettingController@index');
 }
开发者ID:kamaroly,项目名称:shift,代码行数:12,代码来源:SettingController.php

示例4: getConfirmEmail

 public function getConfirmEmail($token)
 {
     try {
         $email = Crypt::decrypt($token);
         $userQuery = DB::table('users')->where('email', $email);
         $user = $userQuery->first();
         if (isset($user)) {
             switch (\Config::get('app.registerMode')) {
                 case 'auto':
                     $userQuery->update(['active' => 1]);
                     Util::flash(trans('auth.confirmed'), '', Util::ALERT_SUCCESS);
                     // Foi enviado um email.
                     return view('auth/login');
                     break;
                 case 'confirm':
                     $userQuery->update(['pending' => 1]);
                     return view('info', ['title' => trans('auth.pending-approval_confirmation'), 'text' => trans('auth.pending-approval')]);
                     break;
             }
         } else {
             Util::flash(trans('auth.user'), '', Util::ALERT_ERROR);
         }
         // Não existe o email.
     } catch (Exception $e) {
         Util::flash(trans('auth.token'), '', Util::ALERT_ERROR);
         // Token inválido.
     }
     return Redirect::action(self::HOME_ACTION);
 }
开发者ID:hramose,项目名称:laravel5-adminLTE-1,代码行数:29,代码来源:AuthController.php

示例5: handle

 /**
  * Run the request filter.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @param  string  $role
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($request->user()->role != 'client') {
         return Redirect::action('Auth\\AuthController@getLogin');
     }
     return $next($request);
 }
开发者ID:spwin,项目名称:controlmystock,代码行数:15,代码来源:ClientMiddleware.php

示例6: handle

 /**
  * Run the request filter.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @param  string  $role
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($request->user()->role != 'admin' && $request->user()->role != 'user') {
         return Redirect::action('ClientController@index');
     }
     return $next($request);
 }
开发者ID:spwin,项目名称:controlmystock,代码行数:15,代码来源:AdminMiddleware.php

示例7: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CreateBookRequest $request)
 {
     $user = \Auth::User();
     if (!$user) {
         return view('auth.login')->withErrors('You are not loged in, please loged in !');
     }
     $book = $request->bookFillData();
     $book['user_id'] = $user->id;
     $book['published_at'] = Carbon::parse($request->get('published_at'))->format('Y-m-d');
     $fileSizeValidation = \Config::get('library.image_file_size');
     $newBook = Book::create($book);
     $newBook->syncAuthors($request->get('authors'));
     $this->manager->createDirectory($newBook->id);
     $file = $_FILES['image'];
     if ($file['size'] > 0) {
         // Additional image validation
         if (!starts_with($file['type'], 'image/')) {
             return Redirect::action('BookController@create')->withErrors('Invalid file format, please use image !');
         }
         $fileSize = $file['size'] / 1024;
         if ($fileSize > $fileSizeValidation) {
             return Redirect::action('BookController@create')->withErrors('The image may not be greater than ' . $fileSizeValidation . ' kilobytes. ');
         }
         $img = Image::make($_FILES['image']['tmp_name']);
         $img->resize(140, 140);
         $img->save('.' . \Config::get('library.uploads.webpath') . DIRECTORY_SEPARATOR . $newBook->id . '/cover.jpg');
     }
     return redirect::action('BookController@index')->withSuccess("The book with title '{$newBook->title}' was created.");
 }
开发者ID:EmilAleksandrov,项目名称:book-library-laravel,代码行数:35,代码来源:BookController.php

示例8: store

 /**
  * Store a newly created report.
  *
  * @param Request $request
  * @return Response
  */
 public function store(Request $request)
 {
     if ($request['professor']['lattes']->isValid()) {
         $professor = new Professor($request['professor']);
         $professor->makeReport();
         return Redirect::action('ReportsController@show')->with('professor', $professor);
     }
 }
开发者ID:AdeilsonSilva,项目名称:engsoft,代码行数:14,代码来源:ReportsController.php

示例9: getShortlink

 public function getShortlink($id)
 {
     $album = Album::find($id);
     if (!$album) {
         App::abort(404);
     }
     return Redirect::action('AlbumsController@getTrack', [$id, $album->slug]);
 }
开发者ID:nsystem1,项目名称:Pony.fm,代码行数:8,代码来源:AlbumsController.php

示例10: getShortlink

 public function getShortlink($id)
 {
     $playlist = Playlist::find($id);
     if (!$playlist || !$playlist->canView(Auth::user())) {
         App::abort(404);
     }
     return Redirect::action('PlaylistsController@getPlaylist', [$id, $playlist->slug]);
 }
开发者ID:nsystem1,项目名称:Pony.fm,代码行数:8,代码来源:PlaylistsController.php

示例11: index

 public function index()
 {
     if (Auth::user()->username != '1-0275071849') {
         $organization = Auth::user()->organization;
         return \View::make('home', ['organization' => $organization]);
     } else {
         return Redirect::action('InspectorController@index');
     }
 }
开发者ID:alexsynarchin,项目名称:Itnk5,代码行数:9,代码来源:DashboardController.php

示例12: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $this->validate($request, $this->rules);
     $input = Input::all();
     //		unset($input['_token']);
     $forum_post = ForumPost::create($input);
     //		Redirect::action('UserController@profile', array(1));
     return Redirect::action('ForumPostController@show', array($forum_post))->with('message', 'Forum created');
 }
开发者ID:sarfraz-akhtar01,项目名称:coutallure-laravel,代码行数:14,代码来源:ForumPostController.php

示例13: createNormal

 /**
  * Non Ajax Version
  */
 public function createNormal()
 {
     $imageableType = Input::get('imageable_type');
     $imageableId = Input::get('imageable_id');
     if (empty($imageableType) || empty($imageableId)) {
         return Redirect::action('AdminEventsController@index')->with('warning', 'Wrong Access');
     }
     $this->render('admin.photos.create-normal', compact('imageableType', 'imageableId'));
 }
开发者ID:christiannwamba,项目名称:laravel-site,代码行数:12,代码来源:AdminPhotosController.php

示例14: documentUpdate

 public function documentUpdate(Request $request, $id)
 {
     $document = \App\Models\Document::find($id);
     $document->document_date = Input::get('document_date');
     $document->actual_date = Input::get('actual_date');
     $document->save();
     $user = \App\Models\User::find($document->user_id);
     return Redirect::action('AdminController@organization', [$user->organization_id]);
 }
开发者ID:alexsynarchin,项目名称:Itnk5,代码行数:9,代码来源:AdminController.php

示例15: 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)
 {
     dd($request['products']);
     $products = $request['products'];
     $user_id = \Auth::user()->id;
     $this->validate($request, ['street2' => 'required|max:255|string', 'house_nr2' => 'required|max:255|string', 'postalcode2' => 'required|max:255|string', 'city2' => 'required|max:255|string']);
     \App\User::query()->where('id', $user_id)->update(array('street2' => $request['street2'], 'house_nr2' => $request['house_nr2'], 'postalcode2' => $request['postalcode2'], 'city2' => $request['city2']));
     return Redirect::action('PagesController@pay', compact('products'));
 }
开发者ID:justmemaarten,项目名称:vlambeer,代码行数:16,代码来源:UserController.php


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