1. Go to this page and download the library: Download bigsinoos/j-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/ */
bigsinoos / j-eloquent example snippets
class Role extends \Eloquent {
use \Bigsinoos\JEloquent\PersianDateTrait;
protected $table = 'roles';
}
class Role extends \Eloquent {
use \Bigsinoos\JEloquent\PersianDateTrait;
protected $jalaliDateFormat = 'l j F Y H:i';
}
# or
class Role extends \Eloquent {
use \Bigsinoos\JEloquent\PersianDateTrait;
public function setJalaliFormat($format){
// do custom things here
$this->jalaliDateFormat = $format; return $this;
}
protected function getJalaliFormat()
{
// return any format you want
return 'l j F Y H:i';
}
}
Class Role extends \Eloquent {
use \Bigsinoos\JEloquent\PersianDateTrait;
/**
* Add this method to customize your date attributes
*
* @return array
*/
protected function getDates()
{
return ['created_at', 'updated_at', 'expired_at'];
}
}