Я использую laravel 5.8 и хочу использовать access global config () в классе проверки запросов, но он не работает
namespace App\Http\Requests;
use App\AppConstant;
use Illuminate\Foundation\Http\FormRequest;
class Something extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'url' => 'required',
'category' => 'in:'.implode(",", config('app.categories').''
];
}
}
, и вот часть моего config / app.php
return [
'name' => env('APP_NAME', 'Laravel'),
'categories' => [
'games',
'entertainment'
],
но на выходе получается
Class App\\Http\\Requests\\Something does not exist
when i remove config() from request file it works very well