app/Models/Country.php
/**
     * Get the indexable data array for the model.
     *
     * @return array
     */
Get the indexable data array for the model.
@return array
Get the indexable data array for the model . @return array
public function toSearchableArray()
    {
        $array = $this->toArray();
        $states = $this->states;
        foreach ($states as $state) {
            $array['states'][]['state_name'] = $state->name;
        }
        return $array;
    }
public function toSearchableArray ( ) { $ array = $ this -> toArray ( ) ; $ states = $ this -> states ; foreach ( $ states as $ state ) { $ array [ 'states' ] [ ] [ 'state_name' ] = $ state -> name ; } return $ array ; }
Get the indexable data array for the model.
Get the indexable data array for the model .