Giter VIP home page Giter VIP logo

laravel-options's People

Contributors

adriangonzales avatar akoepcke avatar apiaget avatar armandsar avatar christophheich avatar cjonstrup avatar crivion avatar gizburdt avatar jerodev avatar jornatf avatar kevinruscoe avatar m1guelpf avatar markvaughn avatar mesingh avatar ovanschie avatar realrashid avatar svenluijten avatar teuunn avatar uniconstructor avatar yaroslawww avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-options's Issues

A feature question

Hi,
Now, we can only get options from database, but sometime i do not change them frequently, so in a short time, they seem like constant.

Yep, i want to ask, in the future the project will be added a feature about to cache options from database or not.

Incompatibility with Illuminate\Database\Eloquent\Model::delete()

After installing this package and migrating I get the following error whenever using the option global helper in a route.

"Declaration of Appstract\Options\Option::delete($key) should be compatible with Illuminate\Database\Eloquent\Model::delete()"

After commenting out the delete($key) method everything seems to work just fine

User-specific options

It would be cool if you would be able to store key/value pairs by user so just add the user id to the table and make the option-function only getting the value by key and user.

Problems with composer update

Hi,
I'm having this problem when updating with composer update with composer install no problem.
Thxs!

Declaration of Appstract\Options\Option::delete($key) should be compatible with Illuminate\Database\Eloquent\Model::delete()

I have continued to investigate, the error appears when I updated your package to 1.1.0

"require": {
        "php": "^7.1.3",
        "appstract/laravel-options": "^1.0",
        "fideloper/proxy": "^4.0",
        "intervention/image": "^2.4",
        "laravel/framework": "5.7.*",
        "laravel/tinker": "^1.0",
        "laraveles/spanish": "^1.1",
        "spatie/laravel-permission": "^2.26",
        "yajra/laravel-datatables-oracle": "~8.0"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.2",
        "beyondcode/laravel-dump-server": "^1.0",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^2.0",
        "phpunit/phpunit": "^7.0"
    },

Option array

Hi,
Are we able to add an array to the option value then we could loop the values via for each in controller or blade.

Cheers

Add type column

I suggest adding new column for type because developer may need to get all settings with x type for any use like (Building admin dashboard for changing those settings)

Caching - revisited

Hi there,

Thanks for maintaining this package - I've found it really useful over the years.

I have the need to cache option lookups in the app I'm working on at the moment - and it's not hard to DIY. But I wondered if there was still any appetite to add it into the package itself. I can see a previous discussion #24 and a PR attempted, but I was thinking of something much simpler - either an extra $cacheSeconds parameter to the option/get code - or just a new getCached() method to be more explicit.

Enable travis checks for PRs to pass

I have a few suggestions for the project.
First I think it would benefit if the PRs could have the travis check block merging.

They are enabled on a per branch basis by checking the
https://github.com/appstract/laravel-options/settings/branches
image

Further recommend removing - COMPOSER_FLAGS="--prefer-lowest" from the travis.yml file.

And finally in the https://github.com/appstract/laravel-options/settings setting the merge button to squash merge
image
Squash merging PRs reduces the amount of nit/fix commits to one

add autoload option proposal

Hi @gizburdt
I used this package for my laravel application.
Thank you a lot for creating in package.

i have a problem:
i have some option that call in every page loaded for example logo url or Footer Copyright text.
when call every option method in your package, laravel send separate request to database.
i suggest add a new column autoload in yout option table with format enum(yes,no), that in every request loaded all autoload option in cache. with one request.e.g. select * from options where autoload = yes
this system also usage in option WordPress CMS.

Auto-register migrations

Hey,

I was wondering, since the instructions mention the migrations, but there's often no need to change them. Is it possible to auto-register the migrations from the Service Provider, as explained here?

I'd love to hear your opinions on this.

Cheers!

Add ability to add query scopes to the options model

Hi,

I have a project where I'd normally pull in this package - but I need to be able to apply a global scope to the Option model. So I was wondering about some way to register the scope(s) which could get applied in a booted() method on the model. Something like (assuming there was a config/options.php) :

protected static function booted()
{
    foreach (config('options.global_scopes', []) as $scopeClass) {
        static::addGlobalScope(new $scopeClass);
    }
}

I'd happily work on a PR if it was something you'd be interested in allowing for.

Add Comment Field to Keys

Is there any possibility that we can add a comment to the key-values. It should be stored separately and should not change when update values. I'm working on it. Will give an update.

Getting Error in Laravel 8: BadMethodCallException Call to undefined method Appstract\Options\Option::option_all()

After installing this package and migrating I got the following error. I made this below function in "vendor/appstract/laravel-options/src/helpers.php"

if (! function_exists('option_all')) {
/**
* Get all options in key => value pair
*
* @return array
*/
function option_all()
{
return app('option')->option_all();
}
}
but I am getting this error "BadMethodCallException Call to undefined method Appstract\Options\Option::option_all()" and unable to resolve. It's urgent Please advise.

cast to json

Please i suggest that cast to json must be an option of developer

Migrate error on MariaDB

Hi,
I have try and it work on local but when i push to live server running MariaDB the migrate error
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json not null) default character set utf8mb4 collate 'utf8mb4_unicode_ci'' at line 1 (SQL: create tableoptions (idbigint unsigned not null auto_increment primary key,keyvarchar(191) not null,value json not null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')

I think it because MariaDB not support json type. Please advise.

Thank for great tool

Laravel 11

Hi, is this upgraded to support Laravel 11

    - Root composer.json requires appstract/laravel-options ^5.7 -> satisfiable by appstract/laravel-options[5.7.0].
    - appstract/laravel-options 5.7.0 requires illuminate/support ^6.0|^7.0|^8.0|^9.0|^10.0 -> found illuminate/support[v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.16, v10.0.0, ..., v10.48.2] but these were not loaded, likely because it conflicts with another require.```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.