Skip to content

Commit df1d093

Browse files
committed
Better config maker
1 parent d402e63 commit df1d093

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

src/Commands/Actions/MakeCRUD.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function handle()
2424
$config = config("easy_panel.crud.$name");
2525

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

3030
$this->modelNameIsCorrect($name, $config['model']);

src/Commands/stub/crud.stub

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ return [
44
'model' => {{ model }}::class,
55

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

99
// Manage actions in crud
1010
'create' => true,
@@ -24,17 +24,11 @@ return [
2424

2525
// Write every fields in your db which you want to have a input
2626
// Available types : "ckeditor", "text", "file", "textarea", "password", "number", "email", "select"
27-
'fields' => [
28-
'title' => 'text',
29-
'content' => 'textarea',
30-
'image' => 'file'
31-
],
27+
'fields' => [],
3228

3329
// Where files will store for inputs
34-
'store' => [
35-
'image' => 'images/articles'
36-
],
30+
'store' => [],
3731

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

0 commit comments

Comments
 (0)