An open API service indexing awesome lists of open source software.

https://github.com/nicolashuber/larapid

A simple free alternative for Laravel Nova.
https://github.com/nicolashuber/larapid

admin-dashboard admin-panel cms control-panel inertiajs laravel laravel-nova laravel-package vuejs

Last synced: 3 months ago
JSON representation

A simple free alternative for Laravel Nova.

Awesome Lists containing this project

README

          

# Larapid

![Status](https://img.shields.io/badge/Status-working%20in%20progress-1abc9c.svg "Status")
![Stars](https://img.shields.io/github/stars/nicolashuber/larapid.svg "Stars")

![Laravel](https://img.shields.io/badge/Laravel-FF2D20?style=for-the-badge&logo=laravel&logoColor=white "Laravel")
![Vue.js](https://img.shields.io/badge/Vue.js-35495E?style=for-the-badge&logo=vue.js&logoColor=4FC08D "Vue.js")

A simple free alternative for Laravel Nova.

## Install

### Installing via Composer
```
composer require internexus/larapid
```

### Publish packages resources
```
php artisan vendor:publish --tag=larapid
```

## Usage

### Create a service provider
```php
rules('required'),
Email::make('E-mail', 'email')->rules('required|email|max:255'),
Password::make('Senha', 'password')->rules('required|min:6|max:255'),
];
}
}
```

## Fields

### Text
```php
Text::make('Label', 'column')
```
### Date
```php
Date::make('Created at', 'created_at')
```
### Datetime
```php
Datetime::make('Created at', 'created_at')
```
### Boolean
```php
Boolean::make('Public')
```
### Email
```php
Email::make('E-mail')
```
### Password
```php
Password::make('Password')
```
### Url
```php
Url::make('Url')
```
### Money
```php
Money::make('Price')
```
### Number
```php
Number::make('Price')->min(10)->max(100)
```
### Select
```php
Select::make('Status')->options([1 => 'Approved', 2 => 'Cancelled'])
```
### Textarea
```php
Textarea::make('Content')
```
### Media
```php
Media::make('Featured image', 'media_id')
->accept(['jpg', 'png'])
->maxSize(100000) // in bytes
->minDimension(100, 100)
->maxDimension(1920, 1080)
```
### HasMany
```php
HasMany::make('User posts', 'user_id', PostEntity::class, 'posts')
```
### BelongsTo
```php
BelongsTo::make('User role', 'role_id', UserEntity::class)
```

## Available Fields methods

### Attributes
- `help(string $text)`
- `readOnly()`
- `placeholder(string $placeholder)`

### Validations
- `rules(array $rules)`
- `creationRules(array $rules)`
- `updateRules(array $rules)`

### Visibility
- `showOnIndex()`
- `showOnDetail()`
- `showOnCreating()`
- `showOnUpdating()`
- `hideFromIndex()`
- `hideFromDetail()`
- `hideWhenCreating()`
- `hideWhenUpdating()`
- `onlyOnIndex()`
- `onlyOnDetail()`
- `onlyOnForms()`
- `exceptOnForms()`

### Search and sort
- `sortable()`
- `searchable()`

## Available Entity methods
### Visibility
- `fieldsForIndex()`
- `fieldsForDetail()`
- `fieldsForCreating()`
- `fieldsForUpdating()`

### Actions
- `enableEditing()`
- `enableDetail()`
- `enableDeleting()`

### Hooks
- `beforeSaving()`
- `afterCreated()`
- `afterUpdated()`

### Redirects
- `redirectAfterCreate(Model $model)`
- `redirectAfterUpdate(Model $model)`
- `redirectAfterDelete(Model $model)`