generated from combindma/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Combind
committed
Jul 29, 2024
1 parent
d22b3ea
commit 22c26c7
Showing
7 changed files
with
97 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,24 @@ | ||
<?php | ||
|
||
return [ | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Default Option Store | ||
| Default disk | ||
|-------------------------------------------------------------------------- | ||
| | ||
| This option controls the default option connection that gets used while | ||
| using this caching library. This connection is used when another is | ||
| not explicitly specified when executing a given caching function. | ||
| | ||
| Supported: "database", "file" | ||
| This is the default disk that will be used to store the options file. | ||
| | ||
*/ | ||
|
||
'default' => env('OPTION_DRIVER', 'file'), | ||
|
||
'disk' => 'local', | ||
/* | ||
|-------------------------------------------------------------------------- | ||
| Option Stores | ||
| Default filename | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Here you may define all of the option "stores" for your application as | ||
| well as their drivers. You may even define multiple stores for the | ||
| same option driver to group types of items stored in your options. | ||
| This is the default filename for the options file. | ||
| | ||
*/ | ||
|
||
'stores' => [ | ||
'database' => [ | ||
'driver' => 'database', | ||
'table' => 'options', | ||
'connection' => null, | ||
], | ||
|
||
'file' => [ | ||
'driver' => 'file', | ||
'path' => storage_path('framework/app/options'), | ||
'single_file' => true, | ||
], | ||
], | ||
'filename' => 'options.json', | ||
]; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,11 @@ | ||
<?php | ||
|
||
if (! function_exists('option')) { | ||
/** | ||
* Add Or Retrieve Option. | ||
* | ||
* @param string $key | ||
* @param mixed $default | ||
* @return mixed $value | ||
*/ | ||
function option($key = null, $default = null) | ||
{ | ||
if (! is_null($key)) { | ||
return app('armincms.option')->get($key, $default); | ||
} | ||
|
||
return app('armincms.option')->store(); | ||
} | ||
} | ||
use Combindma\Option\Option; | ||
use Spatie\Valuestore\Valuestore; | ||
|
||
if (! function_exists('option_exists')) { | ||
/** | ||
* Check existance of option. | ||
* | ||
* @return bool | ||
*/ | ||
function option_exists(string $key) | ||
if (! function_exists('option')) { | ||
function option(): Valuestore | ||
{ | ||
return option()->has($key); | ||
return (new Option)->make(); | ||
} | ||
} |