We are using Laravel
and we have multiple models controllers.
Ex:
Model1
and Model2
and they corresponding controllers Controller1
and Controller2
. We need to make a new entry for Model2
every time we create new entry for Model1
.
The question is, is it bad practice to make new entries in Model1
and Model2
in Controller1
public function store(Request $request)
{
//Create new Model1
$model1 = new Model1;
$model1->bla = "Model1";
$model1->save();
//Create new Model2
$model2 = new Model2;
$model2->bla = "Model2";
$model2->save();
}