-
-
Notifications
You must be signed in to change notification settings - Fork 90
Ladmin Option
Asep edited this page Apr 5, 2022
·
3 revisions
You can save data into Ladmin Option if at any time needed, the system works like a cache but it was stored in the database and cache and will always sync, if the cache is not found then the data will be retrieved from the database and re-syncronized.
ladmin()->setOption('foo', 'bar');
// Input String
Can also store array data
ladmin()->setOption('foo', ['bar' => 'baz']);
// Input Array
ladmin()->getOptoin('foo', 'default value');
// Output String | Array
ladmin()->deleteOptoin('foo');
// Output Boolean
ladmin()->hasOptoin('foo');
// Output Boolean
In addition to the above method, you can also use the options($method, $key, $value)
method, and the available methods include has|get|set|delete
. See the example below.
ladmin()->option('set', 'foo', ['bar' => 'baz']);
If you don't want to store it in cache, you can disable it via the config file config/ladmin.php
. . .
'option' => [
'cache' => [
'enable' => false,
'driver' => env('CACHE_DRIVER')
]
]
. . .
For the driver cache is fetched based on the default cache of laravel .env
, you can also change it in the config file as above.
- #1 Create Module
- #2 Create Menu
- #3 Route
- #4 Create DataTables
- #5 Template Layout
- #6 Create Model
- #7 Create Command
- #8 Create Component
- #9 Broadcast Notification
- #10 Group Search
- #11 Flashing Message
- #12 Compiling Assets (ViteJs)
- #13 Ladmin Option
- #14 Utility & Helpers
- #15 Vendor Publish
- #16 Custom Style
- #17 Ladmin Awesome
- #18 Make Money