I have created a method
Campaign model. The
reach() method processes data from the model instance. How can I check whether the data is loaded in current instance or not? e.g,
$campaign = new Campaign; $campaign->reach();
It won't work with this instance, since the eloquent object will be empty this time, but it should work with
$campaign = Campaign::find(1); $campaign->reach();
$campaign will be instance with data loaded from campaigns table.
My question is, how can I know, if the object instance is newly created or loaded with data.