Laravel DB Query

find($id) takes an id and returns a single model. If no matching model exist, it returns null. findOrFail($id) takes an id and returns a single model. If no matching model exist, it throws an error. first() returns the first record found in the database. If no matching model exist, it returns null. firstOrFail() returns the first record found in the database.…… Continue reading Laravel DB Query