App\Http\Controllers\NoticesController::index PHP Method

index() public method

Display a listing of the resource.
public index ( ) : Response
return Response
    public function index()
    {
        if ($unauth = $this->unauth()) {
            return $unauth;
        }
        $request = \Request::all();
        $paginator = Notice::auth()->desc()->paginate(20);
        $data = $paginator->toArray();
        $notices = $data['notices'] = $data['data'];
        unset($data['data']);
        $data['action_types'] = $this->getActions($data['notices']);
        extract($data);
        $panel = ['left' => ['width' => '2', 'class' => 'user-panel'], 'center' => ['width' => '10']];
        return View('notices.index', compact('paginator', 'panel', 'data', array_keys($data)));
    }