This package adds two helper functions to the builder to search multible values within an string or an array.
You can install the package via composer:
composer require wahlemedia/laravel-where-in-array
In your Model you need to have an json object to store an array within
// Your Model Migration
Schema::create('your_model', function (Blueprint $table) {
//...
$table->json('some_attribute')->nullable();
//...
});
If you are working with array, you should cast the field of your model
protected $casts = [
'some_attribute' => 'array',
];
The function you can use by calling the following methods
Model::whereInArray('some_attribute', ['php', 'vue']) // or
Model::whereNotInArray('some_attribute', ['foo'])
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.