public function destroy(TemplateRequest $request, $template)
    {
        $template = $request->template;
        $path = theme_path('views').$template;

        // Block and notify if file does not exist.
        if (! \File::exists($path)) {
            return $this->makeRedirect(false, 'admin.templates.index', sprintf(
                __('msg.not_exists'), $template
            ));
        }

        // Block if file not delete.
        if (! \File::delete($path)) {
            return $this->makeRedirect(false, 'admin.templates.index', sprintf(
                __('msg.not_deleted'), $template
            ));
        }
        
        return $this->makeRedirect(true, 'admin.templates.index', sprintf(
            __('msg.deleted'), $template
        ));
    }
public function destroy(TemplateRequest $request, $template)
    {
        $template = $request->template;
        $path = theme_path('views').$template;

        // Block and notify if file does not exist.
        if (! \File::exists($path)) {
            return $this->makeRedirect(false, 'admin.templates.index', sprintf(
                __('msg.not_exists'), $template
            ));
        }

        // Block if file not delete.
        if (! \File::delete($path)) {
            return $this->makeRedirect(false, 'admin.templates.index', sprintf(
                __('msg.not_deleted'), $template
            ));
        }
        
        return $this->makeRedirect(true, 'admin.templates.index', sprintf(
            __('msg.deleted'), $template
        ));
    }
public function destroy ( TemplateRequest $ request , $ template ) { $ template = $ request -> template ; $ path = theme_path ( 'views' ) . $ template ; // Block and notify if file does not exist. if ( ! \ File :: exists ( $ path ) ) { return $ this -> makeRedirect ( false , 'admin.templates.index' , sprintf ( __ ( 'msg.not_exists' ) , $ template ) ) ; } // Block if file not delete. if ( ! \ File :: delete ( $ path ) ) { return $ this -> makeRedirect ( false , 'admin.templates.index' , sprintf ( __ ( 'msg.not_deleted' ) , $ template ) ) ; } return $ this -> makeRedirect ( true , 'admin.templates.index' , sprintf ( __ ( 'msg.deleted' ) , $ template ) ) ; }
Unlink template file by path.
Unlink template file by path .