1. Go to this page and download the library: Download ubmvn/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 Ubmvn\Settings\HasSettings;
class User extends Model
{
use HasSettings;
}
$user->settings()->set('k1', 'v1');
...
use Ubmvn\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 Ubmvn\Settings\Contracts\Castable;
class CustomCast implements Castable
{
public function set($payload){
//
}
public function get($payload){
//
}}