0
<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Models\FollowReport;
use App\Models\MatchDetail;
use App\Models\Matche;
use App\Models\Points;
use Highlight\Autoloader;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Intervention\Image\Facades\Image;
use PDF;
class MatchDetailController extends Controller {
   
 public function downlaodReport($id)
    {
        $match = Matche::findOrFail($id);
        $won=  $this->getFinalResult($id);
        $view='';
        $customPaper = '';
        switch ($_GET['name']) {
            case 'omr':
                $view = 'admin/ReportsPdf/report-pdf';
                $customPaper =  array(0, 0, 1200, 2000);
                break;
            case 'pmr':
                $view = 'admin/ReportsPdf/pmr-report';
                $customPaper =  array(0, 0, 1200, 3000);
                break;
            
            default:
                $view = 'admin/ReportsPdf/smr-report';
                $customPaper =  array(0, 0, 1000, 1100);
                break;
        }
       
        $pdf = PDF::loadView($view, compact('match', 'won'))->setPaper($customPaper, 'potrait');
        
        return $pdf->download($_GET['name'].'-report.pdf');
        // return view('admin/ReportsPdf/pmr-report',compact('match','won'));
    }
}

这是我的控制器代码,当我运行我的项目时php artisan serve出现错误

当我尝试使用 xampp 运行我的项目时,超过了 60 秒的最大执行时间它可以正常工作任何解决方案吗?

4

1 回答 1

0

更新您的 php.ini 文件

max_execution_time=1500
max_input_time=1000
memory_limit=5000M

您可以调整该值。重新启动您的服务器。

于 2021-08-10T06:57:31.210 回答