1. Go to this page and download the library: Download smartisan/laravel-settings 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/ */
use Smartisan\Settings\HasSettings;
class User extends Model
{
use HasSettings;
}
$user->settings()->set('k1', 'v1');
...
use Smartisan\Settings\Contracts\Repository;
class FileRepository implements Repository
{
public function get($key,$default = null) {
//
}
public function set($key,$value = null) {
//
}
public function forget($key) {
//
}
public function all() {
//
}
}
'repositories' => [
...
'file' => [
...
]
],
use Smartisan\Settings\Contracts\Castable;
class CustomCast implements Castable
{
public function set($payload) {
//
}
public function get($payload) {
//
}
}