flightsadmin / livewire-crud

Generate Complete Livewire CRUD Including Component, Model, Views and Factories from database tables

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Routes?

alrik11es opened this issue · comments

I've been messing with this crud generator. I've struggled to get routes working.
How about suggest the user some route configs? Or just point to the way to use the CRUD results.

When you run php artisan crud:install below Auth routes will be added to the routes file if you choose to Install Auth. If you dont install Auth, Below will not be added. This is from laravel/ui package

//Route Hooks - Do not delete//
Auth::routes();
Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');

When you run php artisan crud:generate posts below Routes are added to the below //Route Hooks - Do not delete//

Route::view('posts', 'livewire.posts.index')->middleware('auth');

image

Let me know if above helps.

Thanks for adding some examples. Strangely it didn't get populated when I ran the command. It seems there is some problem there.

Can you run below command and advise if still issues; Just to test on a new Project, because I did and it worked as expected.
Please create and migrate posts migration file before running last command, or create any table of your choice in the database.
Run composer create-project laravel/laravel:8 myapp to create laravel 8 project.

composer create-project laravel/laravel myapp

composer require flightsadmin/livewire-crud

php artisan crud:install

php artisan crud:generate posts 

Oh! I forgot to run php artisan crud:install.

Thanks for the help.