mercredi 31 octobre 2018

laravel update relationship data manually in controller before forwarding to view(blade)

I have changed data got from relationship of eloquent and now want to update relationship data with my custom data. Any idea how to do that? e.g.

$data = $model->perticularRelaion;
$data->operations; //to update data
now want to do something like this
$model->perticulaRelation = $data;

so when retrieve data in blade it show my updated relationship data.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire