<?php
namespace App\Http\Controllers;
use App\Category;
use App\Author;
use Illuminate\Http\Request;

/**
 * Class AdminController
 * @package App\Http\Controllers
 */
class AdminController extends Controller
{

    /**
     * AdminController constructor.
     */
    public function __construct()
    {
        $this->middleware('auth:admin');
    }
    /**
     * show dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $categories = Category::paginate(25);
        $authors = Author::paginate(25);
        return view('admin.dashboard')->with(compact('categories', 'authors'));
    }
}

?>