PHP code example of ngodingskuyy / laravel-module-generator
1. Go to this page and download the library: Download ngodingskuyy/laravel-module-generator 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/ */
ngodingskuyy / laravel-module-generator example snippets
// Auto-load module routes
if (file_exists(__DIR__ . '/modules.php')) {
use App\Http\Controllers\ProductController;
use Illuminate\Support\Facades\Route;
Route::middleware(['auth', 'verified'])->group(function () {
Route::resource('products', ProductController::class);
Route::get('products/{product}/history', [ProductController::class, 'history'])->name('products.history');
});
// tests/Feature/{Name}Test.php
class ProductTest extends TestCase
{
/** @test */
public function it_can_list_products() { /* ... */ }
/** @test */
public function it_can_create_product() { /* ... */ }
/** @test */
public function it_can_update_product() { /* ... */ }
/** @test */
public function it_can_delete_product() { /* ... */ }
}
bash
php artisan make:feature User
bash
php artisan make:feature User --force
bash
php artisan delete:feature User
bash
php artisan delete:feature User --with=factory,policy,observer,enum,test