tianrosandhy/autocrud-laravel

Admin generator auto CRUD based on Laravel.

Installs: 36

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:project

v1.3.3 2022-08-09 03:30 UTC

README

Installation

First you need to install just like default laravel (but with tianrosandhy/autocrud-laravel)

$ composer create-project tianrosandhy/autocrud-laravel
$ composer install
$ cp .env.example .env
$ php artisan key:generate

then setup .env with correct database connection & base APP_URL

$ php artisan migrate
$ php artisan storage:link

Last, open via browser for initial setup (superadmin account), then after setup finish, you can open CMS in {base_url}/p4n3lb04rd to access the CMS

Workflow

  • Generate module scaffolding
  • Register the module service provider to config/modules.php
  • Prepare the migration file in modules.
  • Generate the datatable & form structure in .app/Modules/{ModuleName}/Http/Structure based on generated migrations (More complete docs will be updated later)
  • Setup the sidebar in ./app/Modules/{ModuleName}/Extenders/SidebarGenerator.php
  • Override controller or route like usual custom module

Available Command

Generate Superadmin

You must run this command first to activate the CMS :

php artisan autocrud:superadmin

This command will guide you to create an initial superadmin account that have all access in CMS.

Module Scaffolding

You can create module easily with this command :

$ php artisan autocrud:module {Module Name}
$ php artisan autocrud:blankmodule {Module Name}

Note : module name will be generated in PascalCase without space.

autocrud:module is to generate a full auto crud, and autocrud:blankmodule is to generate a module basic scaffolding without autocrud. Blank module is useful when you want to create a really customized module without AutoCRUD scaffolding. Then, you need to register the new module's service provider to config (config/modules.php) :

<?php
//config/modules.php
return [
	'load' => [
		'\App\Modules\ModuleExample\Providers\ModuleExampleServiceProvider',
	],
];

After that, you will be able to manage the module in "app/Modules/ModuleExample" for mor customization.

Submodule scaffolding

You can create a submodule easily with this command :

$ php artisan autocrud:submodule {Module Target} {Sub Module Name}
$ php artisan autocrud:blanksubmodule {Module Target} {Sub Module Name}

Note : {Module Target} must be a valid and exists module name. Sub module name will be generated in PascalCase without space.

Same as module scaffolding, but this command will generate a scaffolding in a existing module. So you can group a bunch of module that have a same purpose.