Support the ongoing development of Laravel.io →
posted 11 years ago
Database

Hello, I've been working for a while with laravel components and to be honest, they are good and smart BUT, it is very complex and has much unneeded complexity.

Straight to the point, I am using Laravel Illuminate Database Component (using Composer)

I have setup perfectly but some features do not work at all..

Take for example (what I need atm) touch() method.

This is my code :

Tokens::where('token', '=', $token)->first()->touch();

and the error output is :

 PHP Fatal error:  Call to a member function timestamps() on a non-object in .... the line above

The documentation is not detailed on the uses of many functions as well as all the search results rendered nothing about this issue.

Best Regards

Last updated 3 years ago.
0

Query did not returned any results, thus error. Solve by:

Tokens::where('token', '=', $token)->firstOrFail()->touch();
Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

SAFAD safad Joined 20 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.