Skip to content

Instantly share code, notes, and snippets.

@uyab
Last active October 22, 2021 02:43
Show Gist options
  • Save uyab/a025ce29ae794d226039a613401e29ad to your computer and use it in GitHub Desktop.
Save uyab/a025ce29ae794d226039a613401e29ad to your computer and use it in GitHub Desktop.
Laravolt Auto CRUD configuration file
<?php
// config/laravolt/auto-crud.php
return [
'resources' => [
'user' => [
'label' => 'User',
'model' => \App\Models\User::class,
'schema' => [
[
'type' => \Laravolt\Fields\Field::TEXT,
'name' => 'name',
'label' => 'Name',
'rules' => ['required'],
],
[
'type' => \Laravolt\Fields\Field::EMAIL,
'name' => 'email',
'label' => 'Email',
'rules' => ['required'],
],
[
'type' => \Laravolt\Fields\Field::TEXT,
'name' => 'password',
'label' => 'Password',
'rules' => ['required'],
'visibility' => [
'index' => false,
'create' => true,
'edit' => true,
]
],
[
'type' => \Laravolt\Fields\Field::DROPDOWN,
'name' => 'status',
'options' => ['ACTIVE' => 'ACTIVE', 'PENDING' => 'PENDING'],
'label' => 'Status',
'rules' => ['required'],
],
],
],
],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment