Oct 11, 2014
0
Level 6
Save data into two different tables
Hi guys here is my doubt. Im using "Commander" a really good package created by Jeffrey Way. And I want to save data into 2 separated tables. Here is my "handle" command:
public function handle($command)
{
$link = createStringRandom();
$upload = Upload::register($command->name, $command->email, $command->body, $link);
$this->repository->save($upload);
$upload_id = $upload->id;
$emailfriends = Email::register($upload_id, $command->emailfriend);
$this->repository->saveMultiple($emailfriends);
$this->dispatchEventsFor($upload);
return $upload;
}
1- I think this "handle" function is doing to much. 2- I want to create a 3 table for my files. Im doing this right?
Please or to participate in this conversation.