public function deleteHero($entity, $id)
    {
        $entity = app('Grafite\Cms\Models\\'.ucfirst($entity))->find($id);

        if (app(FileService::class)->delete($entity->hero_image)) {
            $entity->update([
                'hero_image' => null,
            ]);
            Cms::notification('Hero image deleted.', 'success');
            return back();
        }

        Cms::notification('Hero image could not be deleted', 'error');
        return back();
    }
public function deleteHero($entity, $id)
    {
        $entity = app('Grafite\Cms\Models\\'.ucfirst($entity))->find($id);

        if (app(FileService::class)->delete($entity->hero_image)) {
            $entity->update([
                'hero_image' => null,
            ]);
            Cms::notification('Hero image deleted.', 'success');
            return back();
        }

        Cms::notification('Hero image could not be deleted', 'error');
        return back();
    }
public function deleteHero ( $ entity , $ id ) { $ entity = app ( 'Grafite\Cms\Models\\' . ucfirst ( $ entity ) ) -> find ( $ id ) ; if ( app ( FileService :: class ) -> delete ( $ entity -> hero_image ) ) { $ entity -> update ( [ 'hero_image' => null , ] ) ; Cms :: notification ( 'Hero image deleted.' , 'success' ) ; return back ( ) ; } Cms :: notification ( 'Hero image could not be deleted' , 'error' ) ; return back ( ) ; }
Delete the hero image

@param  string $entity
@param  int $id

@return Response
Delete the hero image