src/Http/Controllers/Adminarea/PagesMediaController.php
public function store(ImageFormRequest $request, Page $page): void
    {
        $page->addMediaFromRequest('file')
             ->sanitizingFileName(function ($fileName) {
                 return md5($fileName).'.'.pathinfo($fileName, PATHINFO_EXTENSION);
             })
             ->toMediaCollection('default', config('cortex.pages.media.disk'));
    }
public function store(ImageFormRequest $request, Page $page): void
    {
        $page->addMediaFromRequest('file')
             ->sanitizingFileName(function ($fileName) {
                 return md5($fileName).'.'.pathinfo($fileName, PATHINFO_EXTENSION);
             })
             ->toMediaCollection('default', config('cortex.pages.media.disk'));
    }
public function store ( ImageFormRequest $ request , Page $ page ) : void { $ page -> addMediaFromRequest ( 'file' ) -> sanitizingFileName ( function ( $ fileName ) { return md5 ( $ fileName ) . '.' . pathinfo ( $ fileName , PATHINFO_EXTENSION ) ; } ) -> toMediaCollection ( 'default' , config ( 'cortex.pages.media.disk' ) ) ; }
Store new page media.

@param \Cortex\Foundation\Http\Requests\ImageFormRequest $request
@param \Cortex\Pages\Models\Page                         $page

@return void
Store new page media .