<?php

namespace App\Http\Controllers\Backend\FileManagement;

use Illuminate\Http\Request;
use Illuminate\Contracts\View\View;
use App\Http\Controllers\Controller;
use App\Models\FileModel;

class FileController extends Controller
{


public function viewSubFolderFiles(Request $request,$id): View

{
    //dd($id);
    //  $sub_folder_id = $id;
    $data['sub_folder_id'] = $id;
    $data['all_files'] =FileModel::where('sub_folder_id', $id)->paginate(15);

    // $files =FileModel::paginate(15);
   return view('backend.filemanager.files.view_files', $data);

}



public function viewAllFiles(): View

{
  $data['all_files'] =FileModel::all();

    // $files =FileModel::paginate(15);
  return view('backend.filemanager.files.view_all_files', $data);

}


public function viewFiles(Request $request,$id): View

{
   //  dd($id);

    $sub_folder_id = $id;

   $data['sub_folder_id'] = $id;
   $data['all_files'] =FileModel::where('sub_folder_id', $id)->paginate(15);

    // $files =FileModel::paginate(15);
   return view('backend.filemanager.files.view_files', $data);

}


public function viewSubFiles(Request $request,$id): View

{
   //  dd($id);
     $sub_folder_id = $id;
     $data['sub_folder_id'] = $id;
     $data['all_files'] =FileModel::where('sub_folder_id', $id)->paginate(15);

     return view('backend.filemanager.files.view_files', $data);

}



}
