public function index() { $documents = Document::orderBy('created_at', 'desc')->with('author', 'course')->paginate(15); return view('admin.documents.index', compact('documents')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $documents = Document::orderBy('company')->get(); return view('documents.index')->withDocuments($documents); }