public firstOrFail ( array | string $columns = [] ) : |
||
$columns | array | string | |
return |
public function firstOrFail($columns = [])
{
$record = $this->first($columns);
if (!$record) {
throw (new ModelNotFoundException())->setQuery($this->getUnescapedQuery(), $this->getDn());
}
return $record;
}