EscolaLMS/Courses-Import-Export

View on GitHub
src/Http/Requests/CourseImportAPIRequest.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

namespace EscolaLms\CoursesImportExport\Http\Requests;

use EscolaLms\CoursesImportExport\Models\Course;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Gate;

class CourseImportAPIRequest extends FormRequest
{
    public function authorize(): bool
    {
        return Gate::check('import', Course::class);
    }

    public function rules(): array
    {
        return [
            'file' => ['required', 'mimes:zip'],
        ];
    }
}