larapid
1.0.0
Eine einfache kostenlose Alternative für Laravel Nova.
composer require internexus/larapid
php artisan vendor:publish --tag=larapid
<?phpnamespace AppProviders;use AppEntitiesUserEntity;use IlluminateSupportServiceProvider;use InternexusLarapidFacadesLarapid;class LarapidServiceProvider erweitert ServiceProvider
{öffentliches Funktionsregister()
{
Larapid::entities([
UserEntity::class,
]);
}
} <?phpnamespace AppEntities;use AppModelsUser;use InternexusLarapidEntitiesEntity;use InternexusLarapidFieldsEmail;use InternexusLarapidFieldsPassword;use InternexusLarapidFieldsText;class UserEntity erweitert Entity
{public static $model = User::class;public static $title = 'Usuários';public function field() {return [
Text::make('Nome', 'name')->rules('required'),
Email::make('E-mail', 'email')->rules('required|email|max:255'),
Passwort::make('Senha', 'password')->rules('required|min:6|max:255'),
];
}
} Text::make('Label', 'column') Date::make('Erstellt am', 'created_at') Datetime::make('Erstellt am', 'created_at') Boolean::make('Public') Email::make('E-Mail') Passwort::make('Passwort') URL::make('URL') Money::make('Preis') Number::make('Price')->min(10)->max(100) Select::make('Status')->options([1 => 'Genehmigt', 2 => 'Storniert']) Textarea::make('Content') Media::make('Featured image', 'media_id')
->akzeptieren(['jpg', 'png'])
->maxSize(100000) // in Bytes ->minDimension(100, 100)
->maxDimension(1920, 1080) HasMany::make('Benutzerbeiträge', 'user_id', PostEntity::class, 'posts') BelongsTo::make('Benutzerrolle', '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)