for this code in web.php in routes it is working properly. but when i add 'cors' it gives the error.
Route::group(['prefix' => 'api/zglkv10000', 'middleware' =>['api'] ], function(){ Route::resource('posts', 'PostsController'); });
I used Barryvdh Laravel-cors class to create an API endpoint for my app. I followed the following steps for that.
install it using composer require barryvdh/laravel-cors
updated my middleware group Route::group(['prefix' => 'api/v1', 'middleware' =>['api', 'cors'] ], function(){ Route::resource('posts', 'PostsController'); });
updated config/app.php providers array with Barryvdh\Cors\ServiceProvider::class,
but i got the following error. how can i solve this??
(1/1) ReflectionException
Class cors does not exist in Container.php (line 729)
Please or to participate in this conversation.