datatable.directory codebase https://datatable.directory/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
datatable.directory/app/Http/Controllers/Controller.php

45 lines
1.5 KiB

7 years ago
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
7 years ago
use Illuminate\Http\Request;
7 years ago
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
class Controller extends BaseController
{
7 years ago
use AuthorizesRequests,
DispatchesJobs,
ValidatesRequests {
ValidatesRequests::validate as validate_orig;
ValidatesRequests::validateWithBag as validateWithBag_orig;
}
// Hacks to allow recursive nesting of validations in string and array format
public function makeValidator($data, $rules, $messages = array(), $customAttributes = array())
{
return \Validator::make($data, vali($rules), $messages, $customAttributes);
}
public function validate(Request $request, array $rules,
array $messages = [], array $customAttributes = [])
{
return objBag($this->validate_orig($request, vali($rules), $messages, $customAttributes));
}
public function validateWithBag($errorBag, Request $request, array $rules,
array $messages = [], array $customAttributes = [])
{
return objBag($this->validateWithBag_orig($errorBag, $request, vali($rules),
$messages, $customAttributes));
}
protected function backWithErrors($errors)
{
return back()->withInput()->withErrors($errors);
}
7 years ago
}