phpvms/app/Http/Controllers/Frontend/DashboardController.php

31 lines
678 B
PHP
Raw Normal View History

2017-06-10 04:07:29 +08:00
<?php
namespace App\Http\Controllers\Frontend;
use Illuminate\Support\Facades\Auth;
use App\Http\Controllers\AppBaseController;
2017-08-05 09:17:04 +08:00
use App\Models\Pirep;
use App\Models\User;
class DashboardController extends AppBaseController
2017-06-10 04:07:29 +08:00
{
/**
* Show the application dashboard.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
2017-08-05 09:17:04 +08:00
$pireps = Pirep::orderBy('created_at', 'desc')->take(5)->get();
$users = User::orderBy('created_at', 'desc')->take(5)->get();
return $this->view('dashboard.index', [
'user' => Auth::user(),
2017-08-05 09:17:04 +08:00
'pireps' => $pireps,
'users' => $users,
]);
2017-06-22 05:24:19 +08:00
}
2017-06-10 04:07:29 +08:00
}