Skip to content

Instantly share code, notes, and snippets.

@ojhaujjwal
Last active October 8, 2017 02:42
Show Gist options
  • Save ojhaujjwal/be45651653d2cdc8cec3f1000f690d8d to your computer and use it in GitHub Desktop.
Save ojhaujjwal/be45651653d2cdc8cec3f1000f690d8d to your computer and use it in GitHub Desktop.
<?php
namespace App\Http\Controllers;
use App\User;
use App\Repositories\UserRepository;
use App\Http\Controllers\Controller;
class UserController extends Controller
{
protected $userRepository;
public function __construct(UserRepository $userRepository)
{
$this->userRepository = $userRepository;
}
public function show($id)
{
$user = $this->userRepository->find($id);
return view('user.profile', ['user' => $user]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment