Skip to content

Commit

Permalink
Better config maker
Browse files Browse the repository at this point in the history
  • Loading branch information
reziamini committed Jul 15, 2021
1 parent d402e63 commit df1d093
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Commands/Actions/MakeCRUD.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function handle()
$config = config("easy_panel.crud.$name");

if (!$config) {
throw new CommandNotFoundException("There is no {$name} in config file");
throw new CommandNotFoundException("{$name} has not been set in config/easy_panel.php file");
}

$this->modelNameIsCorrect($name, $config['model']);
Expand Down
14 changes: 4 additions & 10 deletions src/Commands/stub/crud.stub
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ return [
'model' => {{ model }}::class,

// searchable fields, if you dont want search feature, remove it
'search' => [{{ searchFields }}],
'search' => [{{ fields }}],

// Manage actions in crud
'create' => true,
Expand All @@ -24,17 +24,11 @@ return [

// Write every fields in your db which you want to have a input
// Available types : "ckeditor", "text", "file", "textarea", "password", "number", "email", "select"
'fields' => [
'title' => 'text',
'content' => 'textarea',
'image' => 'file'
],
'fields' => [],

// Where files will store for inputs
'store' => [
'image' => 'images/articles'
],
'store' => [],

// which kind of data should be showed in list page
'show' => ['title', 'content', ['user' => 'name']],
'show' => [{{ fields }}],
];

0 comments on commit df1d093

Please sign in to comment.