Q:

difference between find() and where() in Laravel

Can anybody describe what is the difference between find() and where() in Laravel.
Sometimes it's showing the same results but sometimes is showing error.

A:

The where() methods gets translated to a WHERE of the underlying RDBMS (like MySQL, Postgres) and you use this to find records by one or more constraints (color, size). It returns always a Builder instance. 
The find() method is a special where, which used to find a record by its primary ID. It returns an instance of the Eloquent model or a collection (in case you passing multiple IDs to the method) or null (in case no result was found).

