本文整理汇总了PHP中Redirect::action方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirect::action方法的具体用法?PHP Redirect::action怎么用?PHP Redirect::action使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Redirect
的用法示例。
在下文中一共展示了Redirect::action方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
public function update($id)
{
$ip = Ip::findOrFail($id);
$ip->fill(Input::all());
$ip->save();
return Redirect::action('IpController@index');
}
示例2: cargoTarjeta
public function cargoTarjeta()
{
$openpay = Openpay::getInstance('m7bm553khn5nbyn5fg75', 'sk_80f1cd0745f24af8ae46929496601fa5');
// Variable de identificación.
$cliente = array('name' => Input::get('nombre'), 'last_name' => Input::get('apellido'), 'phone' => Input::get('telefono') ?: null, 'email' => Input::get('email'));
$chargeData = array('method' => 'card', 'source_id' => Input::get('token_id'), 'amount' => (double) Input::get('monto'), 'description' => 'Pago póliza seguro', 'device_session_id' => Input::get('deviceIdHiddenFieldName'), 'customer' => $cliente);
try {
$formato = Input::get('formato');
switch ($formato) {
case 'Mensual':
$plazo = 1;
break;
case 'Trimestral':
$plazo = 3;
break;
case 'Semestral':
$plazo = 6;
break;
}
$charge = $openpay->charges->create($chargeData);
if (Input::get('plan')) {
$customer = $openpay->customers->add($cliente);
$cardData = array('token_id' => Input::get('token_id'));
$card = $customer->cards->add($cardData);
$data = array('id_cliente' => $customer, 'id_tarjeta' => $card, 'device_session_id' => Input::get('deviceIdHiddenFieldName'), 'monto' => Input::get('recibos'), 'proximo_pago' => date('Y-m-d', strtotime('+' . $plazo . ' month', strtotime(date('Y-m-d')))), 'pagos_restantes' => 12 - $plazo);
DB::table('planes')->insert($data);
}
} catch (Exception $e) {
$mensaje = "Hubo un error con la tarjeta, no se pudo hacer el cargo. <br> Revísa tu tarjeta e intenta de nuevo, si el problema persiste contáctanos. ";
return Redirect::action('QuoteController@procesarPago', array('opcion' => Input::get('opcion'), 'id' => Input::get('id'), 'monto' => Input::get('monto'), 'plan' => Input::get('plan'), 'recibos' => Input::get('recibos'), 'formato' => Input::get('formato'), 'nombre' => Input::get('primer_nombre'), 'apellido' => Input::get('apellido_paterno'), 'telefono' => Input::get('particular_numero'), 'email' => Input::get('email'), 'error' => true));
}
$mensaje = 'Cargo ejecutado con exito, revise su bandeja';
return Redirect::to('/')->with('message', $mensaje);
}
示例3: open
public function open()
{
if (!\Auth::check()) {
return view('start');
}
return \Redirect::action('HomeController@dashboard');
}
示例4: handleDelete
public function handleDelete()
{
$id = Input::get('flickr_pic');
$pic = Flickr_pic::findOrFail($id);
$pic->delete();
return Redirect::action('FlickrPicController@showFavs');
}
示例5: showWelcome
public function showWelcome()
{
if (Auth::check()) {
return Redirect::action('ProfileController@getProfile', array('username' => Auth::user()->username));
}
$this->layout->content = View::make('home.home');
}
示例6: update
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
$espera = Espera::where('id', $id)->firstOrFail();
$dt = new DateTime();
$espera->update(array('admitido' => 0, 'end_date' => $dt->format('y-m-d H:i:s')));
return Redirect::action('Historial_clinicoController@index')->with('message', 'Paciente eliminado de la lista de espera.');
}
示例7: finalizarchamado
public function finalizarchamado()
{
$intchamadoid = $_GET['id'];
$dtaencerramento = date('Y-m-d H:i:s');
DB::table('tblchamados')->where('intchamadoid', '=', "{$intchamadoid}")->update(array('dtaencerramento' => "{$dtaencerramento}"));
return Redirect::action('chamadosoiController@controlechamado');
}
示例8: postEdit
public function postEdit($id)
{
if (!$this->checkRoute()) {
return Redirect::route('index');
}
$title = 'Edit A Modpack Code - ' . $this->site_name;
$input = Input::only('name', 'deck', 'description', 'slug');
$modpacktag = ModpackTag::find($id);
$messages = ['unique' => 'This modpack tag already exists in the database!'];
$validator = Validator::make($input, ['name' => 'required|unique:modpack_tags,name,' . $modpacktag->id, 'deck' => 'required'], $messages);
if ($validator->fails()) {
return Redirect::action('ModpackTagController@getEdit', [$id])->withErrors($validator)->withInput();
}
$modpacktag->name = $input['name'];
$modpacktag->deck = $input['deck'];
$modpacktag->description = $input['description'];
$modpacktag->last_ip = Request::getClientIp();
if ($input['slug'] == '' || $input['slug'] == $modpacktag->slug) {
$slug = Str::slug($input['name']);
} else {
$slug = $input['slug'];
}
$modpacktag->slug = $slug;
$success = $modpacktag->save();
if ($success) {
Cache::tags('modpacks')->flush();
Queue::push('BuildCache');
return View::make('tags.modpacks.edit', ['title' => $title, 'success' => true, 'modpacktag' => $modpacktag]);
}
return Redirect::action('ModpackTagController@getEdit', [$id])->withErrors(['message' => 'Unable to edit modpack code.'])->withInput();
}
示例9: deposit
public function deposit()
{
//retrieve POST value
$param = Input::only('credits', 'account_id');
$rules = array('credits' => 'required|numeric|min:1,max:1000000', 'account_id' => 'exists:acl_users,id');
$messages = array('buyer_id.exists' => 'Buyer id is not valid.', 'merchant_id.exists' => 'Merchant id is not valid');
$validator = Validator::make($param, $rules, $messages);
if ($validator->passes()) {
$retrieve = Wallet::where('account_id', $param['account_id'])->first();
$credits = array('account_id' => $param['account_id'], 'credits' => $param['credits']);
if (!empty($retrieve)) {
try {
$update = $retrieve->increment('credits', $param['credits']);
if ($update == 1) {
$fundin = array('wallet_id' => $retrieve->id, 'onbehalf' => Auth::user()->id, 'credits' => $param['credits'], 'description' => 'Deposit credits', 'fundtype' => 'fundin');
$funds = Fundinout::create($fundin);
}
} catch (Exception $e) {
return false;
}
} else {
$add_credits = Wallet::create($credits);
$fundin = array('wallet_id' => $add_credits->id, 'onbehalf' => Auth::user()->id, 'credits' => $param['credits'], 'description' => 'Deposit credits', 'fundtype' => 'fundin');
$funds = Fundinout::create($fundin);
}
$message = 'Credit has been successfully added.';
return Redirect::action('roulette.index')->with('success', $message);
} else {
$messages = $validator->messages();
return Redirect::action('roulette.index')->with('error', $messages->all());
}
}
示例10: create
public function create()
{
$data = Input::all();
$promo = new Promo();
$promo->days = Input::get('days');
$promo->code = Crypt::encrypt(Input::get('code'));
$promo->status = 0;
$promo->colony_id = Input::get('colony_id');
if ($promo->save()) {
$user_id = Input::get('admin_colonia');
$admin_user = DB::connection('habitaria_dev')->select('select email from users where id = ? ', [$user_id]);
foreach ($admin_user as $user) {
$admin_email = $user->email;
}
$admin_neighbor = Neighbors::where('user_id', '=', $user_id)->first();
$colony_data = Colony::where('id', '=', $promo->colony_id)->first();
$colony_name = $colony_data->name;
$data = array('email' => $admin_email, 'days' => $promo->days, 'code' => Crypt::decrypt($promo->code), 'colony' => $colony_name, 'admin' => $admin_neighbor->name . ' ' . $admin_neighbor->last_name);
Mail::send('emails.cupon_promo', $data, function ($message) use($admin_email) {
$message->subject('Promo de HABITARIA');
$message->to($admin_email);
});
$notice_msg = 'Promo enviada al administrador de la Colonia: ' . $colony_name;
return Redirect::action('PromoController@report_promo', $promo->colony_id)->with('error', false)->with('msg', $notice_msg)->with('class', 'info');
}
}
示例11: getView
public function getView($characterID)
{
$character = DB::table('account_apikeyinfo_characters')->leftJoin('account_apikeyinfo', 'account_apikeyinfo_characters.keyID', '=', 'account_apikeyinfo.keyID')->leftJoin('seat_keys', 'account_apikeyinfo_characters.keyID', '=', 'seat_keys.keyID')->join('account_accountstatus', 'account_apikeyinfo_characters.keyID', '=', 'account_accountstatus.keyID')->join('character_charactersheet', 'account_apikeyinfo_characters.characterID', '=', 'character_charactersheet.characterID')->join('character_skillintraining', 'account_apikeyinfo_characters.characterID', '=', 'character_skillintraining.characterID')->leftJoin('invTypes', 'character_skillintraining.trainingTypeID', '=', 'invTypes.typeID')->where('character_charactersheet.characterID', $characterID)->first();
// Check if whave knowledge of this character, else, simply redirect to the
// public character function
if (count($character) <= 0) {
return Redirect::action('CharacterController@getPublic', array('characterID' => $characterID))->withErrors('No API key information is available for this character. This is the public view of the character. Submit a API key with this character on for more information.');
}
// Next, check if the current user has access. Superusers may see all the things,
// normal users may only see their own stuffs. SuperUser() inherits 'recruiter'
if (!\Auth::hasAccess('recruiter')) {
if (!in_array(EveAccountAPIKeyInfoCharacters::where('characterID', $characterID)->pluck('keyID'), Session::get('valid_keys'))) {
return Redirect::action('CharacterController@getPublic', array('characterID' => $characterID))->withErrors('You do not have access to view this character. This is the public view of the character.');
}
}
// Determine the other characters that are on this API key
$other_characters = DB::table('account_apikeyinfo_characters')->join('character_charactersheet', 'account_apikeyinfo_characters.characterID', '=', 'character_charactersheet.characterID')->join('character_skillintraining', 'account_apikeyinfo_characters.characterID', '=', 'character_skillintraining.characterID')->where('account_apikeyinfo_characters.keyID', $character->keyID)->where('account_apikeyinfo_characters.characterID', '<>', $character->characterID)->get();
// Get the other characters linked to this key as a person if any
$key = $character->keyID;
// Small var declaration as I doubt you can use $character->keyID in the closure
$people = DB::table('seat_people')->leftJoin('account_apikeyinfo_characters', 'seat_people.keyID', '=', 'account_apikeyinfo_characters.keyID')->whereIn('personID', function ($query) use($key) {
$query->select('personID')->from('seat_people')->where('keyID', $key);
})->groupBy('characterID')->get();
// Finally, give all this to the view to handle
return View::make('character.view')->with('character', $character)->with('other_characters', $other_characters)->with('people', $people);
}
示例12: destroy
public function destroy($id)
{
$articulo = Articulo::findOrFail($id);
$req_id = $articulo->req->id;
$articulo->delete();
return Redirect::action('RequisicionController@show', array($req_id));
}
示例13: update
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id, Request $request)
{
$tipoProyecto = TipoProyecto::findOrFail($id);
$tipoProyecto->tipo_proyecto = $request->input('tipo_proyecto');
$tipoProyecto->save();
return Redirect::action('TiposProyectosController@index');
}
示例14: getFinalize
function getFinalize($method = 'shopify', $url = '')
{
$id = \Session::get('integration_id', 0);
$job = (new GetStoreAuthToken($method, $url, $id))->onQueue('store_auth');
$this->dispatch($job);
return \Redirect::action('Apricot\\StoreController@show', ['id' => $id]);
}
示例15: store
/**
* Store a newly created post in storage.
*
* @return Response
*/
public function store()
{
$validate = Validator::make(Input::all(), Question::$rules);
if ($validate->passes()) {
//save a new Question
$question = new Question();
$question->title = Input::get('title');
$question->body = Input::get('body');
$question->user_id = Auth::id();
$question->save();
$question_id = $question->id;
//saving Tags in Tag Table
/* convert input to array */
$tags_arr = explode(',', Input::get('tag'));
/*
save in Tag table and return object for saving in
Tagmap table
*/
foreach ($tags_arr as $tag_str) {
$tag_obj = Tag::firstOrCreate(array('title' => $tag_str));
//this line will attach a tag ( insert and save automatically )
$new_question->tags()->attach($tag_obj->id);
}
return Redirect::action('QuestionController@index');
}
return Redirect::back()->withErrors($validate)->withInput();
}