larapid
1.0.0
Простая бесплатная альтернатива Laravel Nova.
composer require internexus/larapid
php artisan vendor:publish --tag=larapid
<?phpnamespace AppProviders;use AppEntitiesUserEntity;use IlluminateSupportServiceProvider;use InternexusLarapidFacadesLarapid;класс LarapidServiceProvider расширяет ServiceProvider
{Регистр общедоступной функции()
{
Ларапид::entities([
UserEntity::класс,
]);
}
} <?phpnamespace AppEntities;use AppModelsUser;use InternexusLarapidEntitiesEntity;use InternexusLarapidFieldsEmail;use InternexusLarapidFieldsPassword;use InternexusLarapidFieldsText;класс UserEntity расширяет Entity
{public static $model = User::class;public static $title = 'Usuários';публичные поля функции() {return [
Text::make('Nome', 'name')->rules('required'),
Электронная почта::make('E-mail', 'email')->rules('required|email|max:255'),
Пароль::make('Senha', 'пароль')->rules('требуется|мин:6|макс:255'),
];
}
} Текст::make('Метка', 'столбец') Date::make('Создано', 'create_at') Datetime::make('Создано', 'create_at') Boolean::make('Общедоступный') Электронная почта::make('Электронная почта') Пароль::make('Пароль') URL::make('URL') Деньги::make('Цена') Number::make('Цена')->мин(10)->макс(100) Select::make('Status')->options([1 => 'Одобрено', 2 => 'Отменено']) Textarea::make('Содержимое') Media::make('Избранное изображение', 'media_id')
->принять(['jpg', 'png'])
->maxSize(100000) // в байтах ->minDimension(100, 100)
->maxDimension(1920, 1080) HasMany::make('Сообщения пользователя', 'user_id', PostEntity::class, 'сообщения') BelongsTo::make('Роль пользователя', 'role_id', UserEntity::class) help(string $text)
readOnly()
placeholder(string $placeholder)
rules(array $rules)
creationRules(array $rules)
updateRules(array $rules)
showOnIndex()
showOnDetail()
showOnCreating()
showOnUpdating()
hideFromIndex()
hideFromDetail()
hideWhenCreating()
hideWhenUpdating()
onlyOnIndex()
onlyOnDetail()
onlyOnForms()
exceptOnForms()
sortable()
searchable()
fieldsForIndex()
fieldsForDetail()
fieldsForCreating()
fieldsForUpdating()
enableEditing()
enableDetail()
enableDeleting()
beforeSaving()
afterCreated()
afterUpdated()
redirectAfterCreate(Model $model)
redirectAfterUpdate(Model $model)
redirectAfterDelete(Model $model)