vemto-issues
vemto-issues copied to clipboard
scopeSearch error
When i click the search button on the index page without entering anything in the search box, it comes up with 'TypeError'
App\Models\Expense::scopeSearch(): Argument #2 ($search) must be of type string, null given, called in c:\xampp\pos\vendor\laravel\framework\src\illuminate\Database\Eloquent\Model.php on line 1626
I am using PHP 8.2.4 Laravel version 10.17.0
@donny0814 thank you for reporting
When i click the search button on the index page without entering anything in the search box, it comes up with 'TypeError'
App\Models\Expense::scopeSearch(): Argument #2 ($search) must be of type string, null given, called in c:\xampp\pos\vendor\laravel\framework\src\illuminate\Database\Eloquent\Model.php on line 1626
I am using PHP 8.2.4 Laravel version 10.17.0
Hello @donny0814 Open : app/Models/Scopes/Searchable.php Change This: public function scopeSearch(Builder $query, string $search): Builder To This public function scopeSearch(Builder $query, string $search=null): Builder
Done! Best regards