public function store(Request $request, Media $media, ActivitiesRepo $activities) { $activity = $activities->getById($request->input('activity_id')); return $media->attach($activity, $request->file('file')); }
/** * Remove the specified activity from storage. * * @param int $id * @return Response */ public function destroyImage(Request $request, ActivitiesRepo $repo) { $image_id = $request->input('image_id'); $delete = $repo->removeImage($image_id); return json_encode('true'); }
public function loadMoreActivities(ActivitiesRepo $activities_repo) { $activities = $activities_repo->getAll(10); return ['layout' => view('home.partials.activities-partial', compact('activities'))->render(), 'url' => str_replace('/?', '?', $activities->nextPageUrl()), 'more' => $activities->hasMorePages(), 'galleries' => view('home.partials.gallery-partial-main', compact('activities'))->render()]; }