I would like to look at and return the object referenced by another column with the name id.
As far as I know, there is no other method similar Task::findOrFail($id), but which can refer to another field. For instance:
Task::findOrFail('column_name' = 'column_data');
I am currently using
Task::where('tid' , '=', $tid)->first();
Is it possible?
source
share