How can I retrieve the one-and-only record from the database w/o Model::all();?
I do not know it's id either so I can't use Model::find($id);.
How can I retrieve the one-and-only record from the database w/o Model::all();?
I do not know it's id either so I can't use Model::find($id);.
You can use the first() method to get the first record from the database matching additional conditions if any are included:
$record = Model::first();
This will return an instance of Model, or null if there are no records present.