larapid
1.0.0
Une alternative simple et gratuite pour Laravel Nova.
composer require internexus/larapid
php artisan vendor:publish --tag=larapid
<?phpnamespace AppProviders;use AppEntitiesUserEntity;use IlluminateSupportServiceProvider;use InternexusLarapidFacadesLarapid;class LarapidServiceProvider étend ServiceProvider {registre de fonctions publiques() { Larapid::entités([ UserEntity::classe, ]); } }
<?phpnamespace AppEntities;utiliser AppModelsUser;utiliser InternexusLarapidEntitiesEntity;utiliser InternexusLarapidFieldsEmail;utiliser InternexusLarapidFieldsPassword;utiliser InternexusLarapidFieldsText;class UserEntity extends Entity {public static $model = User::class;public static $title = 'Utilisateurs';public function field() {return [ Text::make('Nome', 'name')->rules('obligatoire'), Email::make('E-mail', 'email')->rules('required|email|max:255'), Mot de passe::make('Senha', 'password')->rules('required|min:6|max:255'), ]; } }
Text::make('Étiquette', 'colonne')
Date::make('Créé à', 'created_at')
Datetime::make('Créé à', 'created_at')
Booléen::make('Public')
E-mail ::make('E-mail')
Mot de passe::make('Mot de passe')
Url::make('Url')
Argent::make('Prix')
Nombre ::make('Prix')->min(10)->max(100)
Select::make('Status')->options([1 => 'Approuvé', 2 => 'Annulé'])
Textarea::make('Contenu')
Media::make('Image en vedette', 'media_id') ->accepter(['jpg', 'png']) ->maxSize(100000) // en octets ->minDimension(100, 100) ->Dimensionmax(1920, 1080)
HasMany::make('Messages utilisateur', 'user_id', PostEntity::class, 'posts')
BelongsTo::make('Rôle utilisateur', '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)