PHP code example of rdehnhardt / eloquent-case

1. Go to this page and download the library: Download rdehnhardt/eloquent-case library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rdehnhardt / eloquent-case example snippets


// 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'];
}