PHP code example of omaralalwi / laravel-time-craft
1. Go to this page and download the library: Download omaralalwi/laravel-time-craft 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/ */
omaralalwi / laravel-time-craft example snippets
return [
// The default column used by all scopes when no field is given.
'default_field' => 'created_at',
// The format used by the HasReadableDates trait for the readable_* accessors.
'readable_datetime_format' => 'F j, Y g:i A',
];
use Illuminate\Database\Eloquent\Model;
use Omaralalwi\LaravelTimeCraft\Traits\HasDateTimeScopes;
class Order extends Model
{
use HasDateTimeScopes;
}
'default_field' => 'your_specific_field',
class Order extends Model
{
use HasDateTimeScopes;
protected $dateField = 'updated_at';
}