Download the PHP package sylarele/laravel-set without Composer
On this page you can find all versions of the php package sylarele/laravel-set. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sylarele/laravel-set
More information about sylarele/laravel-set
Files in sylarele/laravel-set
Package laravel-set
Short Description Set of interfaces, objects, and practices to standardise Laravel backends
License MIT
Informations about the package laravel-set
laravel-set
Set of interfaces, objects, and practices to standardise Laravel backends
Schedule list
Initialise your schedule directory
Add your commands and jobs. Then return an anonymous class that inherits from Sylarele\LaravelSet\Contract\Console\ScheduleInterface.
Then declare your commands in the kernel
In Laravel 10
In Laravel >= 11
See the schedule list :
Media
Rules
When you need to manage multiple media types in your application, it is best to centralize the validation rules in your configuration.
Create an enumeration to list your files:
Create a file_rules.php and image_rules.php configuration file and declare your validation rules:
The rules available for your media are:
- FileRuleConfigDto::fromImage(),
{min: 1kb, max: 400kb, mimes: ['png', 'jpg', 'jpeg', 'webp']}
- FileRuleConfigDto::fromFile(),
{min: 1kb, max: 15mb, mimes: ['*']}
- FileRuleConfigDto::fromPdf(),
{min: 1kb, max: 15mb, mimes: ['pdf']}
- FileRuleConfigDto::fromDocument(),
{min: 1kb, max: 15mb, mimes: ['csv', 'doc', 'docx', 'pdf', 'png', 'jpg', 'jpeg', 'xls', 'xlsx', 'webp']}
You can also rewrite the rules according to your needs by filling in the input parameters.
Declare your configurations in your provider:
In your FormRequest, call your rule with the key from your file:
Modify the translation of the following rules to include the format:
You can inform your fronts with an API endpoint using the service and resource provided by the package.
The following example will return the following JSON: