'Pages', 'route' => Names::route('pages.index'), 'permission' => 'pages.edit'], ]; } /** Where the media library looks for the use of a file: the texts of the pages. */ public function views(): array { return ['pages.index' => 'Opened the pages', 'pages.show' => 'Opened a page']; } public function actions(): array { return [ 'pages.store' => ['Created a page'], 'pages.update' => ['Changed a page'], 'pages.destroy' => ['Removed a page'], ]; } public function boot(): void { app(MediaUsage::class)->register(fn () => Page::query()->get(['body', 'content'])->flatMap(fn (Page $row) => [$row->body, ...array_values(array_filter((array) $row->content, 'is_string'))])); } }