An Artisan command for the Laravel Framework to quickly generate validation syntax from database schema. Still in development.
composer require gillidandaweb/validation-generator
Install the service provider:
// config/app.php
'providers' => [
...
GillidandaWeb\DbCommands\ValidationGeneratorServiceProvider::class,
...
];
To generate validation syntax:
artisan generate:validation {table?} {column?} {--output=controller} {--ignoreuser}
Choose preferred output. Further choices to follow.
--output
$this->validate($request, [
'title' => 'nullable|max:255',
'url' => 'nullable|max:255|url',
'rank' => 'nullable|integer',
'owningcategory_id' => 'nullable|integer|min:0',
]);
Exclude any columns named user_id
--ignoreuser
Gillidanda is a web development company in Glasgow, Scotland.
You are free to use this package as it's MIT-licensed, but if you find this package useful please send us a postcard from your hometown!
Our address is: Gillidanda, 67 Hillfoot Drive, Glasgow, G61 3QG, Scotland.