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


PHP Cookie::queue方法代码示例

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


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

示例1: handleCallback

 public function handleCallback($driver, Request $req)
 {
     $socialuser = \Socialize::with($driver)->user();
     $user = User::where('email', $socialuser->email)->first();
     if (count($user) < 1) {
         $user = new User();
         $user->id = (string) Uuid::generate();
         $user->email = $socialuser->email;
         $user->name = $socialuser->name;
         $user->avatar = $socialuser->avatar;
         $user->save();
     }
     $user = \Auth::loginUsingId($user->id);
     $authcookie = \Cookie::queue('authenticated', true, 20, null, "www.thinkmerit.in", false, false);
     $username = \Cookie::queue('name', $user->name, 20, null, "www.thinkmerit.in", false, false);
     $avatar = \Cookie::queue('avatar', $user->avatar, 20, null, "www.thinkmerit.in", false, false);
     $email = \Cookie::queue('email', $user->email, 20, null, "www.thinkmerit.in", false, false);
     if (app()->environment() == "production") {
         return \Redirect::to("http://www.thinkmerit.in");
     } else {
         return \Redirect::to("http://www.dev.thinkmerit.in");
     }
     /* ->withCookie($authcookie)
        ->withCookie($username)
        ->withCookie($avatar)
        ->withCookie($email);*/
     // ;
 }
开发者ID:Dreamerpro,项目名称:thinkmerit.api,代码行数:28,代码来源:SocialController.php

示例2: showRefLink

 /**
  * [showRefLink description]
  * Route::get('{link?}', ['as' => 'reflink', 'uses' => 'LinkController@showRefLink']);
  *
  * @param [text] $link [referral link]
  *
  * @return [json] [all info abou the link]
  */
 public function showRefLink($link = null)
 {
     //  // If it has a Sponsor Cookie
     if (\Cookie::has('sponsor')) {
         return Redirect::to('/');
         // Load Referral Link View
     }
     if (is_null($link)) {
         return Redirect::to('/');
         // Redirect To HomePage
     }
     try {
         // If has $Link then Look in Database if Exist
         $link = Link::findByLink($link)->load('user.profile');
         $link = $link->toArray();
         // Note Cookie Wont Be Created if Exceeded More than 4kb
         \Cookie::queue('sponsor', $link, 2628000);
         // Return Referral View with Variable Link
         return Redirect::to('/')->with('link', $link);
         // If No Record Found Throw Exception!
     } catch (ModelNotFoundException $e) {
         // Return Back to Home
         return Redirect::to('/');
         // return view('nosponsor');
     }
 }
开发者ID:xenxa,项目名称:royalflushnetwork,代码行数:34,代码来源:LinkController.php

示例3: showHome

 public function showHome()
 {
     if (Auth::check()) {
         $user = Auth::user();
         $data['username'] = preg_replace('/@.*?$/', '', $user->email);
         $data['user'] = $user;
         if (!is_null($user->provider()->first()) && $user->provider()->first()->provider == 'facebook') {
             $data['avatar'] = '<img src="http://graph.facebook.com/' . $user->provider()->first()->provider_id . '/picture?type=small" alt="avatar" />';
         }
     }
     $items = ['home-bg-1.jpg', 'home-bg-2.jpg', 'home-bg-3.jpg', 'home-bg-4.jpg', 'home-bg-5.jpg', 'home-bg-6.jpg', 'home-bg-7.jpg', 'home-bg-8.jpg', 'home-bg-9.jpg', 'home-bg-10.jpg', 'home-bg-12.jpg', 'home-bg-13.jpg', 'home-bg-14.jpg', 'home-bg-15.jpg', 'home-bg-16.jpg', 'home-bg-17.jpg', 'home-bg-18.jpg', 'home-bg-19.jpg', 'home-bg-20.jpg', 'home-bg-21.jpg', 'home-bg-22.jpg', 'home-bg-23.jpg', 'home-bg-24.jpg', 'home-bg-25.jpg', 'home-bg-26.jpg', 'home-bg-27.jpg', 'home-bg-28.jpg', 'home-bg-29.jpg', 'home-bg-30.jpg', 'home-bg-32.jpg', 'home-bg-33.jpg', 'home-bg-34.jpg'];
     $data['introImg'] = $items[array_rand($items)];
     $lastMonth = Carbon::now()->subMonth();
     $popular = Stat::where('created_at', '>=', $lastMonth)->orderBy('hits', 'desc')->take(3)->get();
     $data['popularHashtags'] = [];
     foreach ($popular as $post) {
         $hashtag = $post->board()->first()->hashtag;
         if ($post->board()->first()->config()->first()->user_id == 0) {
             $url = $hashtag . '/szukaj';
         } else {
             $url = $hashtag . '/' . $post->board()->first()->id;
         }
         $href = '<a class="hashtag" href="' . URL::to('/') . '/' . $url . '">#' . $hashtag . '</a>';
         array_push($data['popularHashtags'], $href);
     }
     $data['title'] = $this->layout->title = null;
     $cookie = Cookie::queue('cookie_accept', 'yes', 2628000);
     $this->layout->content = View::make('front.home', $data);
 }
开发者ID:itsfamestudio,项目名称:hashtag,代码行数:29,代码来源:HomeController.php

示例4: getIndex

 public function getIndex()
 {
     // ref
     \Cookie::queue('referrer', Input::get('ref'));
     // abtesting
     $this->data['abFirstStepForm'] = Input::get('v') == 2 ? true : \Config::get('unflare.abtesting.firstStepForm');
     return $this->render('web.root');
 }
开发者ID:stanmay,项目名称:unflare,代码行数:8,代码来源:Root.php

示例5: doChangeLocale

 public function doChangeLocale()
 {
     $locale = Input::get('locale');
     LaravelLocalization::setLocale($locale);
     App::setLocale($locale);
     Cookie::queue('locale', $locale);
     return Response::json(array('status' => true, 'link' => geturl(Input::get('url'))));
 }
开发者ID:OlesKashchenko,项目名称:SkillsProject1,代码行数:8,代码来源:HomeController.php

示例6: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->package('hardywen/cookie-csrf');
     $config = $this->app->config->get('cookie-csrf::config');
     //根据config配置哪些route及提交方法需要调用cookie-csrf
     $this->app->router->when('*', 'cookie-csrf', $config['method']);
     //将csrf token 放进 cookie里
     \Cookie::queue('cookie_csrf_token', csrf_token());
 }
开发者ID:hardywen,项目名称:cookie-csrf,代码行数:14,代码来源:CookieCsrfServiceProvider.php

示例7: views_cookie

 /**
  * 文章瀏覽數
  *
  */
 public static function views_cookie($type, $id)
 {
     $key = $type . '_' . $id;
     if (Cookie::get($key)) {
         return false;
     }
     Cookie::queue($key, 1, 5);
     return true;
 }
开发者ID:kettanyam,项目名称:20141001done,代码行数:13,代码来源:helper.php

示例8: index

 public function index()
 {
     if (\Input::get('theme')) {
         \Cookie::queue('theme', \Input::get('theme'), 100);
         return Redirect::to('/')->withCookie(cookie('theme', \Input::get('theme'), 100));
     }
     $data = array('videos' => Video::where('active', '=', '1')->orderBy('created_at', 'DESC')->simplePaginate($this->videos_per_page), 'current_page' => 1, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/videos', 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
     //dd($data['videos']);
     return View::make('Theme::home', $data);
 }
开发者ID:rinodung,项目名称:hello-video-laravel,代码行数:10,代码来源:ThemeHomeController.php

示例9: getLogin

 public function getLogin($id)
 {
     $curl = new Acme\Repositories\Curl();
     $result = json_decode($curl->postToken($id, 1234, 'http://app' . $id . '.dev/login/' . $id, Input::get('code')));
     if (isset($result->access_token)) {
         Cookie::queue('access_token', $result->access_token, $result->expires_in / 60);
     } else {
         Cookie::queue('access_token', null);
     }
     return Redirect::to('/')->with(Input::all());
 }
开发者ID:kelixlabs,项目名称:demo-l4-oauth,代码行数:11,代码来源:ClientController.php

示例10: create

 /**
  * View Login page
  * @return [type] [description]
  */
 public function create()
 {
     if (Auth::check()) {
         return Redirect::intended('/');
     }
     $cookies = Cookie::get();
     foreach ($cookies as $name => $cookie) {
         Cookie::queue(Cookie::forget($name));
     }
     return View::make('login');
 }
开发者ID:marklauyq,项目名称:firstclass-dev,代码行数:15,代码来源:SessionsController.php

示例11: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  Requests\Frontend\StoreCommentRequest $request
  * @return \Illuminate\Http\Response
  */
 public function store(Requests\Frontend\StoreCommentRequest $request)
 {
     if ($comment = Comment::create($request->all())) {
         \Session::flash('comment.success', '评论发布成功, 审核通过即可显示');
         \Cookie::queue('comment_url', $comment->url);
         \Cookie::queue('comment_email', $comment->email);
         \Cookie::queue('comment_nickname', $comment->nickname);
         return back();
     }
     \Session::flash('comment.fail', '评论发布失败');
     return back()->withInput();
 }
开发者ID:niefufeng,项目名称:drip,代码行数:18,代码来源:CommentController.php

示例12: postIndex

 public function postIndex()
 {
     $vars = array('class' => 'CRP', 'level' => 5, 'craftable_only' => 0, 'slim_mode' => 0, 'rewardable_too' => 0);
     $values = array();
     foreach ($vars as $var => $default) {
         $values[] = Input::has($var) ? Input::get($var) : $default;
     }
     $url = '/equipment/list?' . implode(':', $values);
     // Queueing the cookie, we won't need it right away, so it'll save for the next Response::
     Cookie::queue('previous_equipment_load', $url, 525600);
     // 1 year's worth of minutes
     return Redirect::to($url);
 }
开发者ID:sevenredreturns,项目名称:ffxivcrafting,代码行数:13,代码来源:EquipmentController.php

示例13: removeTTN

 public function removeTTN()
 {
     $id = Input::get('id');
     if (!$id) {
         throw new RuntimeException();
     }
     $idsCookie = Cookie::get('zd_ttn_numbers');
     if (($key = array_search($id, $idsCookie)) !== false) {
         unset($idsCookie[$key]);
     }
     Cookie::queue('zd_ttn_numbers', $idsCookie, Settings::get('cookie_save_time'));
     return Response::json(array('status' => true));
 }
开发者ID:OlesKashchenko,项目名称:SkillsProject2,代码行数:13,代码来源:HomeController.php

示例14: index

 public function index()
 {
     $map_units = array();
     //$map_units[] = (new MapUnit('53.076455,82.357315'))->getLatLon();
     //$map_units[] = (new GPRMCUnit('$GPRMC,123347.000,A,4313.7477,N,02752.4516,E,0.00,284.40,080811,,,D*63'))->getLatLon();
     $comet_token = Auth::user()->createCometToken();
     Cookie::queue('comet_token', $comet_token);
     $map_units = MapUnit::all()->toArray();
     View::share('page_key', 'home');
     View::share('page_title', 'Test');
     $this->layout->header = View::make('header');
     $this->layout->map_part = View::make('show-map');
     $this->layout->map_part->map_units = $map_units;
 }
开发者ID:tymiles003,项目名称:gps-gmap-web-app,代码行数:14,代码来源:HomeController.php

示例15: postProjectsSort

 public function postProjectsSort($param)
 {
     $lang = Cookie::get('lang', 'ru');
     $sort = Cookie::get("sort_{$param}", 'ASC');
     $load = Input::get('load');
     $projects = Project::select('project_id', 'project_alias', "project_keywords_{$lang}", "project_description_{$lang}", "project_name_{$lang}", "project_text_{$lang}", "project_image_preview", "project_date_start", "project_date_stop", "updated_at")->orderBy($param, $sort)->limit($load)->get();
     $projects_count = Project::count();
     if ($sort == 'ASC') {
         Cookie::queue("sort_{$param}", 'DESC');
     } else {
         Cookie::queue("sort_{$param}", 'ASC');
     }
     $tpl = View::make('layouts.projects')->with(array('projects' => $projects, 'projects_count' => $projects_count, 'lang' => $lang))->render();
     return Response::json(array('success' => true, 'status' => 200, 'tpl' => $tpl, 'param' => $param, 'sort' => $sort));
 }
开发者ID:ROKIRA,项目名称:TENDERS,代码行数:15,代码来源:HomeController.php


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