Object of class Illuminate\Database\Eloquent\Collection could not be converted to int code example
Example: Object of class Illuminate\\Database\\Eloquent\\Builder could not be converted to string
Put "->first();" in the end of function call
Put "->first();" in the end of function call