mercredi 7 octobre 2015

Laravel : Handle findOrFail( ) on Fail

I am looking for something which can be like findOrDo(). Like do this when data not found. Something could be like

Model::findOrDo($id,function(){
   return "Data not found";
});

Is there any similar thing in laravel that I can do this elegantly and beautifully ?

*I tried googling but could not find one



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire