Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace AppHttpControllers;
- use IlluminateHttpRequest;
- use AppRepositoriesUserRepository as User;
- use AppTraitsResponseTrait;
- class HomeController extends Controller
- {
- use ResponseTrait;
- private $user;
- /**
- * Create a new controller instance.
- *
- * @return void
- */
- public function __construct(User $user)
- {
- $this->user = $user;
- $this->middleware('auth');
- }
- /**
- * Show the application dashboard.
- *
- * @return IlluminateHttpResponse
- */
- public function index()
- {
- //dd($this->user->all()->toArray());
- //You can ignore the self:: part, as it doesn't reach this far.
- self::setData($this->user->all()->toArray());
- return "test";
- return view('home');
- }
- }
- namespace AppTraits;
- trait ResponseTrait {
- public function setData($array) {
- }
- }
- "psr-4": {
- "App\": "app/"
- }
Add Comment
Please, Sign In to add comment