Hello thank you
but it was avaible yesterday before the update.
And now with 5.0.2 it can't be found and when i check the file it's no more here as you can see on git it was remove like 2 weeks ago and that fix got implemented into 5.0.2
It's still there, only it doesn't make sense at all to have it static on the Model, since it is a method on the Eloquent\Builder class. So feel free to use it and don't worry at all.
Have in mind that every static call to the model is either served by the Model static methods, or by the Eloquent\Builder on the instantiated object, or if no such methods exists, on the Query\Builder. Only then will you get BadMethodCallException, if there is no methods defined on the latter.
I was using a trait to catch the fail exception (ModelNotFoundException) and retrow then as TenantModelNotFoundException. In the trait i had a method findOrFail that replaced the parent method that was on the model.
/**
* Override the default findOrFail method so that we can rethrow a more useful exception.
* Otherwise it can be very confusing why queries don't work because of tenant scoping issues.
*
* @param $id
* @param array $columns
*
* @throws TenantModelNotFoundException
*/
public static function findOrFail($id, $columns = ['*'])
{
try {
return parent::findOrFail($id, $columns);
} catch (ModelNotFoundException $e) {
throw with(new TenantModelNotFoundException())->setModel(get_called_class());
}
}
how can i achieve the same result (parent::findOrFail($id, $columns);) now that findOrFail is not available in the model?