<?php

namespace Daylight\Core\Modules\MediaLibrary\Http\Controllers;

use Daylight\Core\Http\Controllers\Controller;
use Illuminate\Routing\Controllers\HasMiddleware;
use Illuminate\Routing\Controllers\Middleware;

class MediaController extends Controller implements HasMiddleware
{
    public static function middleware(): array
    {
        return [
            new Middleware('can:read:media'),
        ];
    }

    public function __invoke(?string $directory = null)
    {
        return view('daylight::media.index');
    }
}
