/** * Handling Users Profile Pictures Uploads * @param UsersPhotos $photo [description] * @return [type] [description] */ public function dp(Request $request, UsersPhotos $photo) { $this->Validate($request, ['dp' => 'required|max:3000|mimes:jpg,jpeg,png']); $photo->UserProfilePicture($request->file('dp'), \Auth::user()); session()->flash('success_message', 'Your Profile Picture has been updated'); return back(); }
/** * [composeUserPhotos description] * @return [type] [description] */ public function composeUserPhotos() { view()->composer('user.user', function ($view) { $view->with('photos', UsersPhotos::images()->get()); }); }