If you want to extend one of the modules and add new fields (or remove some) you will need to overwrite the views first. To do that just copy a view from the vendor folder to the resources folder:
To edit theadmin/userview simply copy vendor/taffovelikoff/hotcoffee/resources/views/admin/user.blade.php to resources/views/vendor/hotcoffee/admin/user.blade.php
Extending the user module
If you need to add more fields in the user module you first have to copy the user.blade.php from vendor/taffovelikoff/hotcoffee/resources/views/admin to resources/views/vendor/hotcoffee/admin and add your new field where you desire (for example right after "job title"):
It's recommended to keep the user information in the user_address table, instead of the users table. Now create a migration to add the new fields to the table.
In this file you can change some user configurations, but most importantly you can change the UserAddress namespace.
return [/* |-------------------------------------------------------------------------- | User Address Model |-------------------------------------------------------------------------- | This allows to extend the model. | */'address_model'=> \App\Models\UserAddress,
Now create a new UserAddress model and populate the fillable attribute.
If you need to do some validations you can add the rules and messages again in the users.php config file:
/*|--------------------------------------------------------------------------| Additional validation rules|--------------------------------------------------------------------------| Any additional validation rules and messages when updating or creating| user. You can also overwrite the defaults.*/'validations'=> ['normal'=> ['phone'=>'required',// This will add a new validation for "phone". ],'translatable'=> [],// Add rules for translatable fields heree],'messages'=> ['normal'=> ['phone.required'=>'Please provide a phone number.', ],'translatable'=> [],// Add messages for translatable fields heree],
If you need to do something very specific you can copy the UserController.php from vendor/taffovelikoff/hotcoffee/src/Http/Controllers/Admin to app/Http/Controllers/Admin and re-define all the routes in your routes/web.php:
<?php/** * ADMIN * Below are all custom admin routes for your application. */HotCoffee::routes();Route::group(['prefix'=>config('hotcoffee.prefix'),'middleware'=> ['hotcoffee']],function () {// DashboardRoute::get('/dashboard','Admin\DashboardController@index')->name('hotcoffee.admin.dashboard');// ===== OVERWRITING USERS MODULE ROUTES ===== //// Users (keep route names the same)Route::group(['prefix'=>'users'],function () {Route::get('/','Admin\UserController@index')->name('hotcoffee.admin.users.index');Route::get('/create','Admin\UserController@create')->name('hotcoffee.admin.users.create');Route::post('/','Admin\UserController@store')->name('hotcoffee.admin.users.store');Route::get('/{user}','Admin\UserController@edit')->name('hotcoffee.admin.users.edit');Route::post('/{user}','Admin\UserController@update')->name('hotcoffee.admin.users.update');Route::delete('/{user}','Admin\UserController@destroy')->name('hotcoffee.admin.users.destroy'); });});
Now the admin panel will use the controller from the app/Http/Controllers/Admin folder, instead the one in vendor/taffovelikoff/hotcoffee/src/Http/Controllers/Admin meaning you can edit the controller.
If you are not sure about the route names of a module you can check them either with php artisan route:list or open vendor/taffovelikoff/hotcoffee/routes/web.php.
Extending the article and info page modules
You can extend or change the article or info page modules in a very similar way.
<?php/*|--------------------------------------------------------------------------| Info Pages|--------------------------------------------------------------------------| Configuration concerning the info pages.|*/return [/* |-------------------------------------------------------------------------- | Models |-------------------------------------------------------------------------- | This allows to extend the model. | */'model'=>App\Models\InfoPage::class,