| Q | A
| ----------------- | ---
| Bug? | no (error)
| New Feature? | no
| Framework | Laravel
| Framework version | 5.4.*
| Package version | 7.0.0
| PHP version | 7.2.4
Get last Audit
Call to undefined method Illuminate\Database\Query\Builder::last()
although fetching all audits work fine
Audit::all();
I think the error message is pretty much self explanatory. There's no such method in the query builder by that name.
This isn't related to the package itself, more to Eloquent/Builder.
Try sorting by latest and get the first.
ya m doing that,
its mentioned in the documentation.
// Get last Audit
$last = $article->audits()->last();
i gusess then it should be removing from documentation.
It should be $last = $article->audits->last(); instead. Thanks for the heads up.
Most helpful comment
ya m doing that,
its mentioned in the documentation.
i gusess then it should be removing from documentation.