laravellegends / interactive-model
This library is helpful to record data in the Eloquent models interactively via the command line.
Installs: 6 982
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Requires
Requires (Dev)
- orchestra/testbench: ^3.4
This package is auto-updated.
Last update: 2024-10-18 19:22:54 UTC
README
This is a Laravel package to help you to record data in the Eloquent models interactively via the command line.
Instalation
Now, run in terminal:
composer require laravellegends/interactive-model
Usage examples
Example:
php artisan model:interactive User
or
php artisan model:interactive App\\Models\\User
Type the "name" value:
> Wallace Maxters
Type the "email" value:
> wallacemaxters@test.com
Type the "password" value:
> [automatic hidden]
Data inserted in table users
This command assume that your models is placed in App\Models
namespace by default, if you not passed full namespace as argument.
The data asked to fill should be defined in $fillable
in your model. For fields placed in $hidden
, the prompt is automatically hidden.
Example:
namespace App\Models; class User extends Model { protected $fillable = ['name', 'email', 'password']; protected $hidden = ['password']; }