I don't have a ton of experience with Sushi, so there may be a better way. But this how I'm passing
I don't have a ton of experience with Sushi, so there may be a better way. But this how I'm passing parameters to my Sushi model currently:
class ProductCompatibleVehicle extends Model
{
use Sushi;
protected static array $vehicle_ids = [];
public static function queryForVehicleIds(array $ids): Builder
{
static::$vehicle_ids = $ids;
return static::query();
}
public function getRows()
{
if (!self::$vehicle_ids) {
return [];
}
// ... prepare rows ...
return $rows;
}
}