mardi 30 mai 2017

Error while trying to show route:list in Laravel 5.4

I'am trying to use an API in laravel 5.4,and while executing in command-line 'php artisan route:list' to retreive all site routes, but unfortunately i get this error :

[ReflectionException] Class App\Http\Controllers\Api\V1\CausesController.php does not exist

this is my Controller :

namespace App\Http\Controllers\Api\V1;

use App\Cause;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Requests\Admin\StoreCausesRequest;
use App\Http\Requests\Admin\UpdateCausesRequest;
use App\Http\Controllers\Traits\FileUploadTrait;

class CausesController extends Controller
{
use FileUploadTrait;

public function index()
{
    return Cause::all();
}

}

and this is my api.php :

<?php

Route::group(['prefix' => '/v1', 'namespace' => 'Api\V1', 'as' =>    'api.'], function () {

Route::resource('causes', 'CausesController.php');

});

Thanks.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2rA4J1D
via IFTTT

Aucun commentaire:

Enregistrer un commentaire