PHP code example of pion / laravel-support-eloquent
1. Go to this page and download the library: Download pion/laravel-support-eloquent 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/ */
pion / laravel-support-eloquent example snippets
public $cleanAttributes = [
"name"
];
public $dontCleanAttributes = [
"name"
];
public $nullEmptyAttributes = [
"name"
];
public $dontNullEmptyAttributes = [
"name"
];
public $dateAttributes = ['custom_date'];
public $dateFormats = [
'born' => 'Y-m-d'
];
/**
* Set a given attribute on the model.
*
* @param string $key
* @param mixed $value
*/
public function setAttribute($key, $value)
{
parent::setAttribute($key, alter_attribute_value($key, $value, $this, [
'tryToCleanAttributeValue',
'tryToNullAttributeValue'
]));
}