2017-06-09 02:28:26 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
2017-08-10 14:00:08 +08:00
|
|
|
use App\Models\User;
|
2017-12-16 01:22:46 +08:00
|
|
|
use Illuminate\Database\QueryException;
|
2017-06-09 02:28:26 +08:00
|
|
|
|
2017-08-02 07:40:05 +08:00
|
|
|
class HomeController extends AppBaseController
|
2017-06-09 02:28:26 +08:00
|
|
|
{
|
2017-06-10 04:07:29 +08:00
|
|
|
/**
|
|
|
|
* Show the application dashboard.
|
|
|
|
*/
|
2017-06-09 02:28:26 +08:00
|
|
|
public function index()
|
|
|
|
{
|
2017-12-16 01:22:46 +08:00
|
|
|
try {
|
|
|
|
$users = User::orderBy('created_at', 'desc')->take(4)->get();
|
|
|
|
} catch (QueryException $e) {
|
|
|
|
return view('system/errors/not_installed');
|
|
|
|
}
|
|
|
|
|
2017-08-10 14:00:08 +08:00
|
|
|
return $this->view('home', [
|
|
|
|
'users' => $users,
|
|
|
|
]);
|
2017-06-09 02:28:26 +08:00
|
|
|
}
|
|
|
|
}
|