當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Binput::get方法代碼示例

本文整理匯總了PHP中GrahamCampbell\Binput\Facades\Binput::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP Binput::get方法的具體用法?PHP Binput::get怎麽用?PHP Binput::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GrahamCampbell\Binput\Facades\Binput的用法示例。


在下文中一共展示了Binput::get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: postLogin

 /**
  * Attempt to login the specified user.
  *
  * @return \Illuminate\Http\Response
  */
 public function postLogin()
 {
     $remember = Binput::get('rememberMe');
     $input = Binput::only(['email', 'password']);
     $rules = UserRepository::rules(array_keys($input));
     $rules['password'] = 'required|min:6';
     $val = UserRepository::validate($input, $rules, true);
     if ($val->fails()) {
         return Redirect::route('account.login')->withInput()->withErrors($val->errors());
     }
     $this->throttler->hit();
     try {
         $throttle = Credentials::getThrottleProvider()->findByUserLogin($input['email']);
         $throttle->check();
         Credentials::authenticate($input, $remember);
     } catch (WrongPasswordException $e) {
         return Redirect::route('account.login')->withInput()->withErrors($val->errors())->with('error', 'Your password was incorrect.');
     } catch (UserNotFoundException $e) {
         return Redirect::route('account.login')->withInput()->withErrors($val->errors())->with('error', 'That user does not exist.');
     } catch (UserNotActivatedException $e) {
         if (Config::get('credentials::activation')) {
             return Redirect::route('account.login')->withInput()->withErrors($val->errors())->with('error', 'You have not yet activated this account.');
         } else {
             $throttle->user->attemptActivation($throttle->user->getActivationCode());
             $throttle->user->addGroup(Credentials::getGroupProvider()->findByName('Users'));
             return $this->postLogin();
         }
     } catch (UserSuspendedException $e) {
         $time = $throttle->getSuspensionTime();
         return Redirect::route('account.login')->withInput()->withErrors($val->errors())->with('error', "Your account has been suspended for {$time} minutes.");
     } catch (UserBannedException $e) {
         return Redirect::route('account.login')->withInput()->withErrors($val->errors())->with('error', 'You have been banned. Please contact support.');
     }
     return Redirect::intended(Config::get('core.home', '/'));
 }
開發者ID:xhulioh25,項目名稱:wiki,代碼行數:40,代碼來源:LoginController.php

示例2: postSettings

 /**
  * Updates the status page settings.
  *
  * @return \Illuminate\View\View
  */
 public function postSettings()
 {
     if (Binput::get('remove_banner') == "1") {
         $setting = Setting::where('name', 'app_banner');
         $setting->delete();
     }
     if (Binput::hasFile('app_banner')) {
         $file = Binput::file('app_banner');
         // Image Validation.
         // Image size in bytes.
         $maxSize = $file->getMaxFilesize();
         if ($file->getSize() > $maxSize) {
             return Redirect::back()->withErrorMessage("You need to upload an image that is less than {$maxSize}.");
         }
         if (!$file->isValid() || $file->getError()) {
             return Redirect::back()->withErrorMessage($file->getErrorMessage());
         }
         if (strpos($file->getMimeType(), 'image/') !== 0) {
             return Redirect::back()->withErrorMessage('Only images may be uploaded.');
         }
         // Store the banner.
         Setting::firstOrCreate(['name' => 'app_banner'])->update(['value' => base64_encode(file_get_contents($file->getRealPath()))]);
         // Store the banner type
         Setting::firstOrCreate(['name' => 'app_banner_type'])->update(['value' => $file->getMimeType()]);
     }
     try {
         foreach (Binput::except(['app_banner', 'remove_banner']) as $settingName => $settingValue) {
             Setting::firstOrCreate(['name' => $settingName])->update(['value' => $settingValue]);
         }
     } catch (Exception $e) {
         return Redirect::back()->withSaved(false);
     }
     return Redirect::back()->withSaved(true);
 }
開發者ID:baa-archieve,項目名稱:Cachet,代碼行數:39,代碼來源:DashSettingsController.php

示例3: postUpdateProjectTeamOrder

 /**
  * Updates the order of project teams.
  *
  * @return array
  */
 public function postUpdateProjectTeamOrder()
 {
     $teamData = Binput::get('ids');
     foreach ($teamData as $order => $teamId) {
         ProjectTeam::find($teamId)->update(['order' => $order + 1]);
     }
     return $teamData;
 }
開發者ID:xiuchanghu,項目名稱:Gitamin,代碼行數:13,代碼來源:ApiController.php

示例4: getIncidentTemplate

 /**
  * Returns a template by slug.
  *
  * @throws \Illuminate\Database\Eloquent\ModelNotFoundException
  *
  * @return \CachetHQ\Cachet\Models\IncidentTemplate
  */
 public function getIncidentTemplate()
 {
     $templateSlug = Binput::get('slug');
     if ($template = IncidentTemplate::where('slug', $templateSlug)->first()) {
         return $template;
     }
     throw new ModelNotFoundException("Incident template for {$templateSlug} could not be found.");
 }
開發者ID:kulado,項目名稱:Cachet,代碼行數:15,代碼來源:ApiController.php

示例5: putTeam

 /**
  * Update an existing team.
  *
  * @param \Gitamin\Models\ProjectTeam $team
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function putTeam(ProjectTeam $team)
 {
     try {
         $team = $this->dispatch(new UpdateProjectTeamCommand($team, Binput::get('name'), Binput::get('slug'), Binput::get('order', 0)));
     } catch (QueryException $e) {
         throw new BadRequestHttpException();
     }
     return $this->item($team);
 }
開發者ID:xiuchanghu,項目名稱:Gitamin,代碼行數:16,代碼來源:ProjectTeamController.php

示例6: putIssue

 /**
  * Update an existing issue.
  *
  * @param \Gitamin\Models\Inicdent $issue
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function putIssue(Issue $issue)
 {
     try {
         $issue = $this->dispatch(new UpdateIssueCommand($issue, Binput::get('name'), Binput::get('status'), Binput::get('message'), Binput::get('visible', true), Binput::get('user_id'), Binput::get('project_id'), Binput::get('notify', true), Binput::get('created_at')));
     } catch (QueryException $e) {
         throw new BadRequestHttpException();
     }
     return $this->item($issue);
 }
開發者ID:xiuchanghu,項目名稱:Gitamin,代碼行數:16,代碼來源:IssueController.php

示例7: postGroups

 /**
  * Create a new component group.
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function postGroups()
 {
     try {
         $group = $this->dispatch(new AddComponentGroupCommand(Binput::get('name'), Binput::get('order', 0)));
     } catch (Exception $e) {
         throw new BadRequestHttpException();
     }
     return $this->item($group);
 }
開發者ID:practico,項目名稱:Cachet,代碼行數:14,代碼來源:ComponentGroupController.php

示例8: postMetricPoints

 /**
  * Create a new metric point.
  *
  * @param \CachetHQ\Cachet\Models\Metric $metric
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function postMetricPoints(Metric $metric)
 {
     try {
         $metricPoint = $this->dispatch(new AddMetricPointCommand($metric, Binput::get('value'), Binput::get('timestamp')));
     } catch (Exception $e) {
         throw new BadRequestHttpException();
     }
     return $this->item($metricPoint);
 }
開發者ID:practico,項目名稱:Cachet,代碼行數:16,代碼來源:MetricPointController.php

示例9: postSubscribe

 /**
  * Handle the subscribe user.
  *
  * @return \Illuminate\View\View
  */
 public function postSubscribe()
 {
     try {
         $this->dispatch(new SubscribeSubscriberCommand(Binput::get('email')));
     } catch (ValidationException $e) {
         return Redirect::route('subscribe.subscribe')->withInput(Binput::all())->withTitle(sprintf('<strong>%s</strong> %s', trans('dashboard.notifications.whoops'), trans('gitamin.subscriber.email.failure')))->withErrors($e->getMessageBag());
     }
     return Redirect::route('explore')->withSuccess(sprintf('<strong>%s</strong> %s', trans('dashboard.notifications.awesome'), trans('gitamin.subscriber.email.subscribed')));
 }
開發者ID:xiuchanghu,項目名稱:Gitamin,代碼行數:14,代碼來源:SubscribeController.php

示例10: createSubscriberAction

 /**
  * Creates a new subscriber.
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function createSubscriberAction()
 {
     try {
         dispatch(new SubscribeSubscriberCommand(Binput::get('email')));
     } catch (ValidationException $e) {
         return Redirect::route('dashboard.subscribers.add')->withInput(Binput::all())->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.subscribers.add.failure')))->withErrors($e->getMessageBag());
     }
     return Redirect::route('dashboard.subscribers.add')->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.subscribers.add.success')));
 }
開發者ID:mohitsethi,項目名稱:Cachet,代碼行數:14,代碼來源:SubscriberController.php

示例11: postIncidents

 /**
  * Create a new incident.
  *
  * @param \Illuminate\Contracts\Auth\Guard $auth
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function postIncidents(Guard $auth)
 {
     try {
         $incident = $this->dispatch(new ReportIncidentCommand(Binput::get('name'), Binput::get('status'), Binput::get('message'), Binput::get('visible', true), Binput::get('component_id'), Binput::get('component_status'), Binput::get('notify', true)));
     } catch (Exception $e) {
         throw new BadRequestHttpException();
     }
     return $this->item($incident);
 }
開發者ID:practico,項目名稱:Cachet,代碼行數:16,代碼來源:IncidentController.php

示例12: postSubscribers

 /**
  * Create a new subscriber.
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function postSubscribers()
 {
     try {
         $subscriber = $this->dispatch(new SubscribeSubscriberCommand(Binput::get('email'), Binput::get('verify', false)));
     } catch (QueryException $e) {
         throw new BadRequestHttpException();
     }
     return $this->item($subscriber);
 }
開發者ID:xiuchanghu,項目名稱:Gitamin,代碼行數:14,代碼來源:SubscriberController.php

示例13: putMetric

 /**
  * Update an existing metric.
  *
  * @param \CachetHQ\Cachet\Models\Metric $metric
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function putMetric(Metric $metric)
 {
     try {
         $metric = $this->dispatch(new UpdateMetricCommand($metric, Binput::get('name'), Binput::get('suffix'), Binput::get('description'), Binput::get('default_value'), Binput::get('calc_type', 0), Binput::get('display_chart'), Binput::get('places', 2)));
     } catch (Exception $e) {
         throw new BadRequestHttpException();
     }
     return $this->item($metric);
 }
開發者ID:rafix82,項目名稱:Cachet,代碼行數:16,代碼來源:MetricController.php

示例14: putGroup

 /**
  * Update an existing group.
  *
  * @param \CachetHQ\Cachet\Models\ComponentGroup $group
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function putGroup(ComponentGroup $group)
 {
     try {
         $group = $this->dispatch(new UpdateComponentGroupCommand($group, Binput::get('name'), Binput::get('order', 0)));
     } catch (QueryException $e) {
         throw new BadRequestHttpException();
     }
     return $this->item($group);
 }
開發者ID:minhkiller,項目名稱:Cachet,代碼行數:16,代碼來源:ComponentGroupController.php

示例15: putMetric

 /**
  * Update an existing metric.
  *
  * @param \CachetHQ\Cachet\Models\Metric $metric
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function putMetric(Metric $metric)
 {
     try {
         $metric = dispatch(new UpdateMetricCommand($metric, Binput::get('name'), Binput::get('suffix'), Binput::get('description'), Binput::get('default_value'), Binput::get('calc_type'), Binput::get('display_chart'), Binput::get('places'), Binput::get('default_view', Binput::get('view')), Binput::get('threshold'), Binput::get('order')));
     } catch (QueryException $e) {
         throw new BadRequestHttpException();
     }
     return $this->item($metric);
 }
開發者ID:aksalj,項目名稱:Cachet,代碼行數:16,代碼來源:MetricController.php


注:本文中的GrahamCampbell\Binput\Facades\Binput::get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。