File: /home/imensosw/www/mpl.imenso.co/app/Http/Requests/VenueUpdateTechSpecsRequest.php
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class VenueUpdateTechSpecsRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return $this->input('venue_id') == $this->user()->id;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'capacity' => 'required',
'bio' => '',
'age_restriction' => '',
'gigs' => '',
'venue_hire' => '',
'facilities' => '',
'additional_info' => '',
];
}
/**
* Configure the validator instance.
*
* @param \Illuminate\Validation\Validator $validator
* @return void
*/
public function withValidator($validator)
{
$validator->fails(function ($validator) {
$this->session()->flash('venue-edit-tech-specs-open', true);
return redirect()->back()->withErrors($validator);
});
}
}