亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Laravel adds Api namespace
PHP中文網(wǎng)
PHP中文網(wǎng) 2017-05-16 16:55:57
0
2
769

You can see that a new api folder has been added to the laravel project

This folder is used for the api interface for external development

The path under the api folder is

api\V1\UserController.php

And when defining routes in routes.php

$api = app('api.router');
$api->version('v1', function ($api) {
    $api->get('users/{id}', 'Api\V1\UserController@show');  
});

The class of this Api\V1\UserController cannot be found

Where do I need to configure the Api namespace? Because the api directory is not registered in laravel at all

Where to configure?

PHP中文網(wǎng)
PHP中文網(wǎng)

認(rèn)證高級PHP講師

reply all(2)
淡淡煙草味

composer.json

巴扎黑
php$api->version('v1', ['namespace' => 'Api\V1'], function ($api) {
    $api->get('users/{id}', 'UserController@show');
});
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template