<?php

namespace App\Http\Controllers\API;

use App\Models\DayendReport;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use App\Http\Controllers\AppBaseController;

class ReportAPIController extends AppBaseController
{

public function endday(Request $request){

  if($request->branch_id){
    $reports = DayendReport::with(['items','creator:id,name'])->where('branch_id',$request->branch_id)->orderBy('id','DESC')->paginate(15);
  }else{
    $reports = array();
  }


  return response()->json($reports);
}


}
