2017-06-10 04:07:29 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Frontend;
|
|
|
|
|
2017-08-03 02:13:08 +08:00
|
|
|
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;
|
|
|
|
|
2017-08-03 02:13:08 +08:00
|
|
|
|
|
|
|
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();
|
|
|
|
|
2017-08-03 02:13:08 +08:00
|
|
|
return $this->view('dashboard.index', [
|
|
|
|
'user' => Auth::user(),
|
2017-08-05 09:17:04 +08:00
|
|
|
'pireps' => $pireps,
|
|
|
|
'users' => $users,
|
2017-08-03 02:13:08 +08:00
|
|
|
]);
|
2017-06-22 05:24:19 +08:00
|
|
|
}
|
2017-06-10 04:07:29 +08:00
|
|
|
}
|