PHP code example of vicenterusso / laravel-magic-date-mutator

1. Go to this page and download the library: Download vicenterusso/laravel-magic-date-mutator 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/ */

    

vicenterusso / laravel-magic-date-mutator example snippets


return [

    /*
    |--------------------------------------------------------------------------
    | Database Format
    |--------------------------------------------------------------------------
    |
    | Desired format to convert any date field
    |
    */
    'database_format' => 'Y-m-d',
];

# Add trait to model
use \VRusso\MagicDateMutator\Traits\DateAutoMutator;
bash
php artisan vendor:publish --provider="VRusso\MagicDateMutator\MagicDateMutatorServiceProvider" --tag="laravel_magic_date_mutator-config"