I'm not sure why but I can dd an array fine but when I want to return it, it goes back as null. When I setup this if-statement, it always goes back as [1]
public function getEventInterestAttribute($event_interest){
dd($event_interest);// //it gets printed OKAY here
if ( ! $event_interest || empty( $event_interest ) ) { //IT PASSES THIS CONDITION and always gets returned as [1] WHY??
$event_interest = [1];
}
return $event_interest;// THIS LINE NEVER GETS REACHED
}
What am I missing ?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire