PHP code example of syberisle / laravel-castable-archive
1. Go to this page and download the library: Download syberisle/laravel-castable-archive 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/ */
syberisle / laravel-castable-archive example snippets
use SyberIsle\Laravel\Cast\Archive;
class MyModel
{
protected $casts = [
'field_name' => Archive\GzArchive::class
];
}
$model->field_name = 'kakaw' // raw attribute = b"ËNÌN,\x07\x00"
$value = $model->field_name; // = 'kakaw'