本文整理汇总了PHP中Illuminate\Support\Facades\Session::put方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::put方法的具体用法?PHP Session::put怎么用?PHP Session::put使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Session
的用法示例。
在下文中一共展示了Session::put方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remote
public function remote($record_label = null, $record_id = null, $remote = null)
{
$this->record_label = ($record_label!="") ? $record_label : $this->db_name ;
$this->record_id = ($record_id!="") ? $record_id : $this->db_name ;
if ($remote!="") {
$this->remote = $remote;
if (is_array($record_label)) {
$this->record_label = current($record_label);
}
if ($this->rel_field!= "") {
$this->record_label = $this->rel_field;
}
} else {
$data["entity"] = get_class($this->relation->getRelated());
$data["field"] = $record_label;
if (is_array($record_label)) {
$this->record_label = $this->rel_field;
}
$hash = substr(md5(serialize($data)), 0, 12);
Session::put($hash, $data);
$this->remote = route('rapyd.remote', array('hash'=> $hash));
}
return $this;
}
示例2: postSendsms
public function postSendsms(Request $request)
{
$mobile = Input::get('mobile');
if (!preg_match("/1[3458]{1}\\d{9}\$/", $mobile)) {
// if(!preg_match("/^13\d{9}$|^14\d{9}$|^15\d{9}$|^17\d{9}$|^18\d{9}$/",$mobile)){
//手机号码格式不对
return parent::returnJson(1, "手机号码格式不对" . $mobile);
}
$data = DB::select("select * from members where lifestatus=1 and mobile =" . $mobile);
if (sizeof($data) > 0) {
return parent::returnJson(1, "手机号已注册");
}
$checkCode = parent::get_code(6, 1);
Session::put("m" . $mobile, $checkCode);
$checkCode = Session::get("m" . $mobile);
Log::error("sendsms:session:" . $checkCode);
$msg = "尊敬的用户:" . $checkCode . "是您本次的短信验证码,5分钟内有效.";
// Input::get('msg');
$curl = new cURL();
$serverUrl = "http://cf.lmobile.cn/submitdata/Service.asmx/g_Submit";
$response = $curl->get($serverUrl . "?sname=dlrmcf58&spwd=ZRB2aP8K&scorpid=&sprdid=1012818&sdst=" . $mobile . "&smsg=" . rawurlencode($msg . "【投贷宝】"));
$xml = simplexml_load_string($response);
echo json_encode($xml);
//$xml->State;
// <CSubmitState xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/">
// <State>0</State>
// <MsgID>1512191953407413801</MsgID>
// <MsgState>提交成功</MsgState>
// <Reserve>0</Reserve>
// </CSubmitState>
// <State>1023</State>
// <MsgID>0</MsgID>
// <MsgState>无效计费条数,号码不规则,过滤[1:186019249011,]</MsgState>
// <Reserve>0</Reserve>
}
示例3: store
/**
* Handle an authentication attempt.
*
* @return Response
*/
public function store()
{
$rules = array('email' => 'required|email', 'password' => 'required');
$validate = Validator::make(Input::all(), $rules);
if ($validate->fails()) {
return Redirect::to('/');
} else {
if (Auth::attempt(array('email' => Input::get('email'), 'password' => Input::get('password'), 'status' => 'Activate'))) {
/*$user = User::where('email','=',$email)->get();
Session::put('user_type',$user[0]->role);
$id = $user[0]->id;
Session::put('created_by',$id);*/
Session::put('user_id', Auth::user()->id);
Session::put('user_name', Auth::user()->username);
Session::put('user_role', Auth::user()->role);
Session::flash('message', 'User has been Successfully Login.');
$roles = Auth::user()->role;
if ($roles = 'admin' || 'manager') {
return Redirect::to('dashboard');
} elseif ($roles = 'user') {
return Redirect::to('profile');
}
} else {
Session::flash('message', 'Your username or password incorrect');
return Redirect::to('/');
}
}
}
示例4: postProcess
public function postProcess(LoginRequest $request)
{
$username = $request->input('username');
$password = $request->input('password');
$user = DB::table('users')->where('username', $username)->first();
if (isset($user)) {
Session::put('username', $user->username);
Session::put('name', $user->name);
Session::put('surname', $user->surname);
}
if (Auth::attempt(['username' => $username, 'password' => $password, 'type' => 'patient'], $request->has('remember'))) {
return redirect()->intended('/login/patient');
}
if (Auth::attempt(['username' => $username, 'password' => $password, 'type' => 'doctor'], $request->has('remember'))) {
return redirect()->intended('/login/doctor');
}
if (Auth::attempt(['username' => $username, 'password' => $password, 'type' => 'nurse'], $request->has('remember'))) {
return redirect()->intended('/login/nurse');
}
if (Auth::attempt(['username' => $username, 'password' => $password, 'type' => 'pharmacist'], $request->has('remember'))) {
return redirect()->intended('/login/pharmacist');
}
if (Auth::attempt(['username' => $username, 'password' => $password, 'type' => 'officer'], $request->has('remember'))) {
return redirect()->intended('/login/officer');
}
return redirect()->back()->with('message', "ขออภัย username หรือ password ไม่ถูกต้อง\nกรุณาลองใหม่");
}
示例5: __construct
public function __construct()
{
Session::put('tracker.stats.days', $this->getValue('days', 1));
Session::put('tracker.stats.page', $this->getValue('page', 'visits'));
$this->minutes = new Minutes(60 * 24 * Session::get('tracker.stats.days'));
$this->authentication = app()->make('tracker.authentication');
}
示例6: incrementReadCounter
public function incrementReadCounter($link, $slug)
{
if (Session::get('last_read_article') !== $slug) {
$link->increment('read_counter');
Session::put('last_read_article', $slug);
}
}
示例7: make
/**
* Make User Session Object
* @return \Alfredoem\Ragnarok\SecUsers\SecUser
*/
public function make($user)
{
$RagnarokUser = new SecUser();
$this->userRagnarok = $RagnarokUser->populate($user);
Session::put($this->getName(), $this->userRagnarok);
return $this->userRagnarok;
}
示例8: store
/**
* Upload attachment to storage
*
* @return Response
*/
public function store(Request $request)
{
if (!Session::has('questions_hash')) {
Session::put('questions_hash', md5(time()));
}
return Response::json(['attachment' => \QuestionsService::uploadAttachment($request->file('upl'))]);
}
示例9: pullClass
public function pullClass($lang)
{
if ($lang == 'ar') {
return Session::put(['pullClass' => 'pull-left', 'pullClassReverse' => 'pull-right']);
}
return Session::put(['pullClass' => 'pull-left', 'pullClassReverse' => 'pull-right']);
}
示例10: quiz
public function quiz()
{
if (Session::has('id') && (Session::get('type') === 'Student' || Session::get('type') === 'SuperAdmin')) {
//$questions = Question::all();
//$ansAr = array(
//);
$random_question = Question::orderBY(DB::raw('Rand()', 'Unique()'))->take(2)->get(array('id', 'q_description', 'q_opt_1', 'q_opt_2', 'q_opt_3', 'q_opt_4', 'q_ans'));
//print_r($random_question);
$cnt = 0;
foreach ($random_question as $tmp) {
// print_r($tmp);
// print("---------------\n-----------------");
$cnt++;
}
$totNoOfQus = $cnt;
//echo $cnt;
$correct_answer = array_pluck($random_question, 'q_ans');
$qIds = array_pluck($random_question, 'id');
$combined = array_combine($qIds, $correct_answer);
// echo '<pre>';
// print_r($combined);
// die;
Session::put('correct_answer', $combined);
Session::put('total_qus', $totNoOfQus);
// return $correct_answer;
return view::make('quiz')->with('title', 'QUIZ')->with('quiz', $random_question);
} else {
echo 'You are not authorised';
}
}
示例11: update
public function update(FreesRequest $request, $id)
{
$data = $request->all();
$this->freeRepository->update($data, $id);
Session::put('success', 'Recurso enviado com sucesso');
return redirect()->route('layout.client');
}
示例12: Login
public function Login(LoginRequest $request)
{
$value = ["email" => $request->get("email"), "password" => $request->get("password")];
if ($request->remember_me == "1") {
$remember = true;
} else {
$remember = false;
}
if ($this->auth->attempt($value, $remember)) {
if ($request->get("email") == "admin@maimallshop.com") {
//admin
return redirect()->route("admin.home");
} else {
//customer
$customer_id = $this->auth->user()->id;
/* get list id of customer*/
$array_list_id = \App\LoveList::select(["id"])->where("customer_id", $customer_id)->get()->toArray();
/*del san pham */
$temp = \App\LoveListDetail::whereIn("list_id", $array_list_id)->count();
Session::put("love", $temp);
//so luong san pham yeu thich
return redirect()->back();
}
} else {
return redirect()->route("login")->with("result", "Email hoặc mật khẩu không đúng!");
}
}
示例13: update
public function update(FreesRequest $request, $id)
{
$data = $request->all();
$this->repository->update($data, $id);
Session::put('success', 'Editado com sucesso');
return redirect()->route('admin.layout.admin');
}
示例14: set
public function set($oauth)
{
Session::put('podio-entry-access-token', $oauth->access_token);
Session::put('podio-entry-refresh-token', $oauth->refresh_token);
Session::put('podio-entry-expires-in', $oauth->expires_in);
Session::put('podio-entry-ref', $oauth->ref);
}
示例15: login
public function login($code)
{
$this->client->authenticate($code);
$token = $this->client->getAccessToken();
Session::put('token', $token);
return $token;
}