PHP code example of arwp / mvc
1. Go to this page and download the library: Download arwp/mvc library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
arwp / mvc example snippets
'providers' => [
// ...
Arwp\Mvc\MvcServiceProvider::class,
// ...
],
public function boot()
{
// ...
Route::middleware(['web', 'auth', 'backend'])
->namespace('App\Http\Controllers\Backend')
->group(base_path('routes/mvc-route.php'));
// ...
}
return [
'path_controller' => 'app/Http/Controllers/Backend', // Controller folder path
'path_model' => 'app/Models', // Model folder path
'path_view' => 'views/backend', // View folder path (e.g., views/backend or views/frontend)
'path_route' => 'routes/mvc-route.php', // Route file path (default: routes/mvc-route.php)
'route_prefix' => '', // Optional route prefix (e.g., backend, admin)
];
return [
// ...
'path_route' => 'routes/web.php', // Change this to your desired route file path
// ...
];
//{{route replacer}} DON'T REMOVE THIS LINE
bash
php artisan make:mvc User
bash
php artisan make:mvc User view
bash
php artisan vendor:publish --provider="Arwp\Mvc\MvcServiceProvider"