本文整理汇总了PHP中GrahamCampbell\Binput\Facades\Binput::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Binput::all方法的具体用法?PHP Binput::all怎么用?PHP Binput::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrahamCampbell\Binput\Facades\Binput
的用法示例。
在下文中一共展示了Binput::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: putMetric
/**
* Update an existing metric.
*
* @param \CachetHQ\Cachet\Models\Metric $metric
*
* @return \CachetHQ\Cachet\Models\Metric
*/
public function putMetric(Metric $metric)
{
$metric->update(Binput::all());
if ($metric->isValid('updating')) {
return $this->item($metric);
}
throw new BadRequestHttpException();
}
示例2: putIncident
/**
* Update an existing incident.
*
* @param \CachetHQ\Cachet\Models\Inicdent $incident
*
* @return \CachetHQ\Cachet\Models\Incident
*/
public function putIncident(Incident $incident)
{
$incident->update(Binput::all());
if ($incident->isValid('updating')) {
return $this->item($incident);
}
throw new BadRequestHttpException();
}
示例3: 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')));
}
示例4: putMetric
/**
* Update an existing metric.
*
* @param \CachetHQ\Cachet\Models\Metric $metric
*
* @return \Illuminate\Http\JsonResponse
*/
public function putMetric(Metric $metric)
{
try {
$metric->update(Binput::all());
} catch (Exception $e) {
throw new BadRequestHttpException();
}
return $this->item($metric);
}
示例5: 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')));
}
示例6: putIncident
/**
* Update an existing incident.
*
* @param \CachetHQ\Cachet\Models\Inicdent $incident
*
* @return \Illuminate\Http\JsonResponse
*/
public function putIncident(Incident $incident)
{
try {
$incident->update(Binput::all());
} catch (Exception $e) {
throw new BadRequestHttpException();
}
return $this->item($incident);
}
示例7: postSubscribe
/**
* Handle the subscribe user.
*
* @return \Illuminate\View\View
*/
public function postSubscribe()
{
$subscriber = Subscriber::create(['email' => Binput::get('email')]);
if (!$subscriber->isValid()) {
return Redirect::back()->withInput(Binput::all())->with('title', sprintf('<strong>%s</strong> %s', trans('dashboard.notifications.whoops'), trans('cachet.subscriber.email.failure')))->with('errors', $subscriber->getErrors());
}
$successMsg = sprintf('<strong>%s</strong> %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.subscribed'));
event(new CustomerHasSubscribedEvent($subscriber));
return Redirect::route('status-page')->with('success', $successMsg);
}
示例8: postSubscribe
/**
* Handle the subscribe user.
*
* @return \Illuminate\View\View
*/
public function postSubscribe()
{
try {
$subscriber = Subscriber::create(['email' => 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('cachet.subscriber.email.failure')))->withErrors($e->getMessageBag());
}
event(new CustomerHasSubscribedEvent($subscriber));
return Redirect::route('status-page')->withSuccess(sprintf('<strong>%s</strong> %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.subscribed')));
}
示例9: createSubscriberAction
/**
* Creates a new subscriber.
*
* @return \Illuminate\Http\RedirectResponse
*/
public function createSubscriberAction()
{
$email = Binput::get('email');
$subscriber = Subscriber::create(['email' => $email]);
if (!$subscriber->isValid()) {
return Redirect::back()->withInput(Binput::all())->with('title', sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.subscribers.add.failure')))->with('errors', $subscriber->getErrors());
}
$successMsg = sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.subscribers.add.success'));
event(new CustomerHasSubscribedEvent($subscriber));
return Redirect::back()->with('success', $successMsg);
}
示例10: createSubscriberAction
/**
* Creates a new subscriber.
*
* @return \Illuminate\Http\RedirectResponse
*/
public function createSubscriberAction()
{
$email = Binput::get('email');
try {
$subscriber = Subscriber::create(['email' => $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());
}
event(new CustomerHasSubscribedEvent($subscriber));
return Redirect::route('dashboard.subscribers.add')->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.subscribers.add.success')));
}
示例11: putMetricPoint
/**
* Updates a metric point.
*
* @param \CachetHQ\Cachet\Models\Metric $metric
* @param \CachetHQ\Cachet\Models\MetircPoint $metricPoint
*
* @return \Illuminate\Http\JsonResponse
*/
public function putMetricPoint(Metric $metric, MetricPoint $metricPoint)
{
$metricPointData = Binput::all();
$metricPointData['metric_id'] = $metric->id;
if ($timestamp = array_pull($metricPointData, 'timestamp')) {
$pointTimestamp = Carbon::createFromFormat('U', $timestamp);
$metricPointData['created_at'] = $pointTimestamp->format('Y-m-d H:i:s');
}
$metricPoint->update($metricPointData);
return $this->item($metricPoint);
}
示例12: postUpdateComponentOrder
/**
* Updates a components ordering.
*
* @return array
*/
public function postUpdateComponentOrder()
{
$componentData = Binput::all();
unset($componentData['component'][0]);
// Remove random 0 index.
foreach ($componentData['component'] as $componentId => $order) {
$component = Component::find($componentId);
$component->update(['order' => $order]);
}
return $componentData;
}
示例13: postSubscribe
/**
* Handle the subscribe user.
*
* @return \Illuminate\View\View
*/
public function postSubscribe()
{
$email = Binput::get('email');
try {
dispatch(new SubscribeSubscriberCommand($email));
} catch (AlreadySubscribedException $e) {
return Redirect::route('subscribe.subscribe')->withTitle(sprintf('<strong>%s</strong> %s', trans('dashboard.notifications.whoops'), trans('cachet.subscriber.email.failure')))->withErrors(trans('cachet.subscriber.email.already-subscribed', ['email' => $email]));
} catch (ValidationException $e) {
return Redirect::route('subscribe.subscribe')->withInput(Binput::all())->withTitle(sprintf('<strong>%s</strong> %s', trans('dashboard.notifications.whoops'), trans('cachet.subscriber.email.failure')))->withErrors($e->getMessageBag());
}
return Redirect::route('status-page')->withSuccess(sprintf('<strong>%s</strong> %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.subscribed')));
}
示例14: createSubscriberAction
/**
* Creates a new subscriber.
*
* @return \Illuminate\Http\RedirectResponse
*/
public function createSubscriberAction()
{
$verified = app(Repository::class)->get('setting.skip_subscriber_verification');
try {
$subscribers = preg_split("/\r\n|\n|\r/", Binput::get('email'));
foreach ($subscribers as $subscriber) {
dispatch(new SubscribeSubscriberCommand($subscriber, $verified));
}
} 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')));
}
示例15: postUpdateUser
/**
* Updates a user.
*
* @param \CachetHQ\Cachet\Models\User $user
*
* @return \Illuminate\View\View
*/
public function postUpdateUser(User $user)
{
$items = Binput::all();
$passwordChange = array_get($items, 'password');
if (trim($passwordChange) === '') {
unset($items['password']);
}
$user->update($items);
if (!$user->isValid()) {
return Redirect::back()->withInput(Binput::except('password'))->with('title', sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.team.edit.failure')))->with('errors', $user->getErrors());
}
$successMsg = sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.edit.success'));
return Redirect::back()->with('success', $successMsg);
}