Hi,
I am trying to clean my controller and I am running into an issue. My model event.php is getting really long and I am hesitant to move more functions to it. So I created a new model called MakeImage to handle images. This allows me to move the logic out of the controller but not overwhelm my event model. It has also allowed me to reuse the same code for organizers and users. However I read everywhere that calling static functions is bad practice.
What should I be doing? Here is an example of my controller updating my event image.
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Event $event)
{
$event->inProgress() ? MakeImage::saveNewImage($request, $event, 1280, 720, 'event') : MakeImage::updateImage($request, $event, 1280, 720, 'event');
$event->updateEventStatus(8, $request);
return $event;
}