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

44 lines
1.5 KiB

<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
class Controller extends BaseController
{
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);
}
}