https://github.com/harshalkatakiya/laravel-crud
Laravel CRUD operation codes
https://github.com/harshalkatakiya/laravel-crud
Last synced: 3 months ago
JSON representation
Laravel CRUD operation codes
- Host: GitHub
- URL: https://github.com/harshalkatakiya/laravel-crud
- Owner: Harshalkatakiya
- Created: 2024-11-24T18:02:10.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-11-24T18:05:06.000Z (6 months ago)
- Last Synced: 2025-01-20T21:19:51.454Z (4 months ago)
- Language: PHP
- Size: 681 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
composer create-project laravel/laravel laravel_crud
cd laravel_crud
php artisan serve(open new CMD in project folder)
php artisan make:model product -m
(-m for generate migration file automatically)
(add fields in generated migration file)
(config .env file for database)
php artisan migrate:fresh
php artisan make:controller ProductController --resource
php artisan make:view products/layouts/app
php artisan make:view products/layouts/header
php artisan make:view products/index
php artisan make:view products/create
php artisan make:view products/edit
php artisan make:view products/show(add these routes)
Route::get('/', [ProductController::class, 'index']);
Route::get('/products/{id}/show', [ProductController::class, 'show']);
Route::get('/products/create', [ProductController::class, 'create']);
Route::post('/products/store', [ProductController::class, 'store']);
Route::get('/products/{id}/edit', [ProductController::class, 'edit']);
Route::patch('/products/{id}/update', [ProductController::class, 'update']);
Route::delete('/products/{id}/delete', [ProductController::class, 'destroy']);(add bootstrap CDN in app.blade.php)