GrafiteInc/CMS

View on GitHub
src/Requests/FileRequest.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Grafite\Cms\Requests;

use Auth;
use Gate;
use Illuminate\Foundation\Http\FormRequest;

class FileRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        if (config('app.env') !== 'testing') {
            return Gate::allows('cms', Auth::user());
        }

        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [];
    }
}