/laravel-errors

An error loader based on Laravel's translation loader

Primary LanguagePHPMIT LicenseMIT

Laravel Errors

GitHub release StyleCI Github All Releases

This package lets you load errors the same way you load translations from your filesystem with multilang support, as simple as:

error('validation.empty');

Installation

Install the package through composer:

composer require naxon/laravel-errors:^1.0.0

Then publish the config file:

php artisan vendor:publish --provider="Naxon\Errors\ErrorsServiceProvider" --tag="config"

And finally, create the errors and languages folder under your resource folder:

├── resources
│   ├── errors
│   │   ├── en
|   |   |   |── validation.php
│   │   ├── he
|   |   |   |── validation.php

Configuration

After you published the config/errors.php file, you may edit the errors path:

return [

    /**
     * The path of the errors folder
     */
    'path' => resource_path('errors'),

];

Testing

Coming soon...

Credits

License

The MIT License (MIT). Please see License File for more information.