We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fresh laravel project with only caffeinated install
Create Module User
RouteServiceProvider
` protected function mapWebRoutes() { Route::group([ 'middleware' => 'web', 'namespace' => $this->namespace, ], function ($router) { require module_path('user', 'Routes/web.php', 'app'); }); }
/** * Define the "api" routes for the module. * * These routes are typically stateless. * * @return void */ protected function mapApiRoutes() { Route::group([ // 'middleware' => 'auth:api', 'namespace' => $this->namespace, 'prefix' => 'api', ], function ($router) { require module_path('user', 'Routes/api.php', 'app'); }); }`
api.php
Route::apiResource('user', 'UserController')
web.php
Route::resource('user', 'UserController');
UserController.php
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show(User $user) { dd($user); }
on web.php
User {#355 #fillable: array:3 [ 0 => "name" 1 => "email" 2 => "password" ] #hidden: array:2 [ 0 => "password" 1 => "remember_token" ] #casts: array:1 [ "email_verified_at" => "datetime" ] #connection: "mysql" #table: "users" #primaryKey: "id" #keyType: "int" +incrementing: true #with: [] #withCount: [] #perPage: 15 +exists: true +wasRecentlyCreated: false #attributes: array:8 [ "id" => 1 "name" => "safsg" "email" => "[email protected]" "email_verified_at" => "2019-10-02 00:00:00" "password" => "sgfdfgfdhf" "remember_token" => null "created_at" => null "updated_at" => null ] #original: array:8 [ "id" => 1 "name" => "safsg" "email" => "[email protected]" "email_verified_at" => "2019-10-02 00:00:00" "password" => "sgfdfgfdhf" "remember_token" => null "created_at" => null "updated_at" => null ] #changes: [] #dates: [] #dateFormat: null #appends: [] #dispatchesEvents: [] #observables: [] #relations: [] #touches: [] +timestamps: true #visible: [] #guarded: array:1 [ 0 => "*" ] #rememberTokenName: "remember_token" }
on api.php
User {#324 #fillable: array:3 [ 0 => "name" 1 => "email" 2 => "password" ] #hidden: array:2 [ 0 => "password" 1 => "remember_token" ] #casts: array:1 [ "email_verified_at" => "datetime" ] #connection: null #table: null #primaryKey: "id" #keyType: "int" +incrementing: true #with: [] #withCount: [] #perPage: 15 +exists: false +wasRecentlyCreated: false #attributes: [] #original: [] #changes: [] #dates: [] #dateFormat: null #appends: [] #dispatchesEvents: [] #observables: [] #relations: [] #touches: [] +timestamps: true #visible: [] #guarded: array:1 [ 0 => "*" ] #rememberTokenName: "remember_token" }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Fresh laravel project with only caffeinated install
Create Module User
RouteServiceProvider
` protected function mapWebRoutes()
{
Route::group([
'middleware' => 'web',
'namespace' => $this->namespace,
], function ($router) {
require module_path('user', 'Routes/web.php', 'app');
});
}
api.php
Route::apiResource('user', 'UserController')
web.php
Route::resource('user', 'UserController');
UserController.php
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show(User $user) { dd($user); }
on web.php
User {#355 #fillable: array:3 [ 0 => "name" 1 => "email" 2 => "password" ] #hidden: array:2 [ 0 => "password" 1 => "remember_token" ] #casts: array:1 [ "email_verified_at" => "datetime" ] #connection: "mysql" #table: "users" #primaryKey: "id" #keyType: "int" +incrementing: true #with: [] #withCount: [] #perPage: 15 +exists: true +wasRecentlyCreated: false #attributes: array:8 [ "id" => 1 "name" => "safsg" "email" => "[email protected]" "email_verified_at" => "2019-10-02 00:00:00" "password" => "sgfdfgfdhf" "remember_token" => null "created_at" => null "updated_at" => null ] #original: array:8 [ "id" => 1 "name" => "safsg" "email" => "[email protected]" "email_verified_at" => "2019-10-02 00:00:00" "password" => "sgfdfgfdhf" "remember_token" => null "created_at" => null "updated_at" => null ] #changes: [] #dates: [] #dateFormat: null #appends: [] #dispatchesEvents: [] #observables: [] #relations: [] #touches: [] +timestamps: true #visible: [] #guarded: array:1 [ 0 => "*" ] #rememberTokenName: "remember_token" }
on api.php
User {#324 #fillable: array:3 [ 0 => "name" 1 => "email" 2 => "password" ] #hidden: array:2 [ 0 => "password" 1 => "remember_token" ] #casts: array:1 [ "email_verified_at" => "datetime" ] #connection: null #table: null #primaryKey: "id" #keyType: "int" +incrementing: true #with: [] #withCount: [] #perPage: 15 +exists: false +wasRecentlyCreated: false #attributes: [] #original: [] #changes: [] #dates: [] #dateFormat: null #appends: [] #dispatchesEvents: [] #observables: [] #relations: [] #touches: [] +timestamps: true #visible: [] #guarded: array:1 [ 0 => "*" ] #rememberTokenName: "remember_token" }
The text was updated successfully, but these errors were encountered: