rdehnhardt/eloquent-case

rdehnhardt Eloquent Case

8.0.1 2021-05-21 15:54 UTC

This package is auto-updated.

Last update: 2024-10-21 23:13:55 UTC


README

Set attributes to upper or lower case automatically. Recommended for business systems.

Installation

Run the following command to get the latest version package

composer require rdehnhardt/eloquent-case
// app/Customer.php
namespace App;

use Illuminate\Database\Eloquent\Model;
use Rdehnhardt\EloquentCase\TransformUpperCase;

class Customer extends Model
{
    use TransformUpperCase;

    /**
     * The attributes that aren't upper case. (optional)
     *
     * @var array
     */
    protected $guardedCase = ['email', 'password'];
}
// app/Customer.php
namespace App;

use Illuminate\Database\Eloquent\Model;
use Rdehnhardt\EloquentCase\TransformUpperCase;

class Customer extends Model
{
    use TransformLowerCase;

    /**
     * The attributes that aren't lower case. (optional)
     *
     * @var array
     */
    protected $guardedCase = ['name'];
}

Contributing

Contributions are welcomed; to keep things organized, all bugs and requests should be opened on github issues tab for the main project in the rdehnhardt/eloquent-case/issues.

All pull requests should be made to the branch Develop, so they can be tested before being merged into the master branch.

Having problems?

If you are having problems with the use of this package, there is likely someone has faced the same problem. You can find common answers to their problems:

License

The eloquent-case package is open source software licensed under the license MIT