public function store(Request $request)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('Media', 'create')) {
            return $this->noPermission();
        }
        return (new Media())->upload($request);
    }
public function store(Request $request)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('Media', 'create')) {
            return $this->noPermission();
        }
        return (new Media())->upload($request);
    }
public function store ( Request $ request ) { // check if user has permissions to access this link if ( ! User :: hasAccess ( 'Media' , 'create' ) ) { return $ this -> noPermission ( ) ; } return ( new Media ( ) ) -> upload ( $ request ) ; }
This function uses upload function that is defined in Media model that uploads files.

@param  Request $request
@return array
This function uses upload function that is defined in Media model that uploads files .