Skip to content

Commit 9353c11

Browse files
author
RK M
committed
Auto Route
1 parent cd5fe70 commit 9353c11

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ This packege based on - (https://github.com/awais-vteams/laravel-crud-generator)
1717
- **Search Filter added**
1818
- **$serchable Property in Model**
1919
- Bootstrap new Design **col-md-6**
20+
- New Feature **Auto Route**
2021

2122

2223

@@ -40,7 +41,13 @@ cd project-name
4041
composer require laravel/ui
4142
```
4243
```
43-
php artisan bootstrap ui --auth
44+
php artisan ui bootstrap --auth
45+
```
46+
```
47+
npm install
48+
```
49+
```
50+
npm run build
4451
```
4552
## Installation
4653
1 - Install
@@ -60,8 +67,10 @@ php artisan make:crud banks
6067
```
6168

6269
Add a route in `web.php`
70+
71+
- Now auto Route Feature **Not Needed**
6372
```
64-
Route::resource('banks', 'BankController');
73+
Route::resource('banks', App\Http\Controlles\BankController:class);
6574
```
6675
Route name in plural slug case.
6776

src/Commands/CoolhaxCrudGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ protected function generateRoutes()
167167
$routeContent = File::get($routePath);
168168

169169
// Define the route string to check and add
170-
$routeString = "Route::resource('" . strtolower($route) . "', '" . $this->name . "Controller');";
170+
$routeString = "Route::resource('" . strtolower($route) . "', App\Http\Controllers\\" . $this->name . "Controller::class);";
171171

172172
// Check if the route string already exists in web.php
173173
if (strpos($routeContent, $routeString) === false) {

0 commit comments

Comments
 (0)