Пример #1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $profiles = Profile::with('playlists')->where('user_id', 1)->first();
     $playlist = $profiles->playlists->filter(function ($playlist) use($id) {
         return (int) $playlist->id === (int) $id;
     })->first();
     return response()->json(['playlist' => $playlist]);
 }
Пример #2
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show(Profile $profile)
 {
     $profiles = $profile->with('user')->paginate(15);
     return view('profiles.show', compact('profile', 'profiles'));
 }
 public function index()
 {
     $profiles = Profile::with(['owner', 'posts', 'logo', 'hero'])->latest()->get();
     return view('profiles.index', compact('profiles'));
 }
Пример #4
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     return response()->json(['profile' => Profile::with('playlists')->where('id', $id)->first()]);
 }
 /**
  * Allow Admin to see specific profile
  *
  * @param $id
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function show($id)
 {
     $is_admin = Auth::user()->is_admin;
     $user_id = Auth::user()->id;
     $profile = Profile::with('user')->where('id', '=', $id)->first();
     $nulls = 0;
     $no_val_html = '<a href="#myProfileModal" data-toggle="modal" role="button"><span class="glyphicon glyphicon-question-sign text-danger"></span></a>';
     $profile_usr = null;
     /*dd($profile);*/
     if ($profile['attributes']) {
         $prof_attrs = count($profile['attributes']) - 4;
         foreach ($profile['attributes'] as $attr) {
             if ($attr == null) {
                 $nulls += 1;
             }
         }
         $profile_usr = $profile['attributes']['user_id'];
         $nulls = number_format(($prof_attrs - $nulls) / $prof_attrs * 100, 0);
     }
     if (($user_id == $profile_usr || $is_admin) && $profile) {
         return view('profile.show', ['profile' => $profile, 'nulls' => $nulls, 'no_val' => $no_val_html]);
     }
     abort(401, 'Unauthorized request.');
 }
 /**
  * Display the specified resource.
  *
  * @param  int   $id
  * @return Response
  */
 public function show($id)
 {
     $profile = Profile::with('users')->where('user_id', '=', $id)->first();
     return view('profile.fullProfile', compact('profile'));
 }
 public function edit($id)
 {
     $profile = Profile::with('user')->findOrFail($id);
     return view('admin.profiles.edit')->with(compact('profile'));
 }
Пример #8
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id = null)
 {
     $user = Auth::user();
     $profile = Profile::with('user')->where('id_user', '=', $user->id)->first();
     return view('profile.detail', compact('profile'));
 }