GrafiteInc / CMS

Decoupled CMS for any Laravel app, gain control of: pages, blogs, galleries, events, images, custom modules and more.
https://cms.grafite.ca
MIT License
495 stars 104 forks source link

CRUD how to see create/edit/delete ? #172

Closed khyoz closed 5 years ago

khyoz commented 6 years ago

I have generated a new module works, with a fresh install (Laravel 5.7), created the migration, executed the php crud command and all is fine. But when I publish the module, and migrate, the only thing I can see by clicking in the menu is the title of the module. bug_crud

To Reproduce create a module, crud and publish the route is defined as the following for a new module works

<?php 

Route::group(['namespace' => 'Cms', 'middleware' => ['web']], function () {

/*
|--------------------------------------------------------------------------
| Work App Routes
|--------------------------------------------------------------------------
*/

Route::resource('works', 'WorksController', ['only' => ['show', 'index']]); 

});

also the controller does not have the store/search/edit/destroy/history....

<?php

namespace Cms\Modules\Works\Controllers;

use Cms;
use CryptoService;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Cms\Modules\Works\Services\WorkService;

class WorksController extends Controller
{
    public function __construct(WorkService $workService)
    {
        $this->service = $workService;
    }

    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index(Request $request)
    {
        return view('works::works.index');
    }
}

How can I create/edit new records and delete ? Did I miss a step ? I have read doc (a little light at this time) and searched but cannot find something about that. Or is it a bug ? Thanks for your support.

mlantz commented 6 years ago

What command did you use? To get a full CRUD component you need to run artisan module:crud {name}

khyoz commented 6 years ago

ok, same remark than for migration issue I did try to follow doc and used as a first step the 1) php artisan module:make Toto 2) php artisan module:crud Toto and the controller, after exception is catched, we see at the end is the one from the make command

Maybe the documentation is not too clear, I do agree with only the crud command, all is running I wiill continue to test... thanks for support !

mlantz commented 5 years ago

php artisan module:make Toto this is intended as a non CRUD based module. You do not need to run both, its one or the other