app/Http/Controllers/ArticlesController.php
/**
     * Remove the specified resource from storage.
     *
     * @param  \App\Models\Articles  $articles
     * @return \Illuminate\Http\Response
     */
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy($articleId)
    {
        try {
            \DB::delete("delete from articles where id = " . $articleId);
            return redirect()->route('editArticleSelection')->with('message', 'article deleted.');
        } catch (Exception $e){
            $log_error = $e->getmessage();
            return redirect()->route('articles')->with('message', 'Failed to delete article - contact ofRoot customer service, or try again.');
        }
    }
public function destroy ( $ articleId ) { try { \ DB :: delete ( " delete from articles where id =  " . $ articleId ) ; return redirect ( ) -> route ( 'editArticleSelection' ) -> with ( 'message' , 'article deleted.' ) ; } catch ( Exception $ e ) { $ log_error = $ e -> getmessage ( ) ; return redirect ( ) -> route ( 'articles' ) -> with ( 'message' , 'Failed to delete article - contact ofRoot customer service, or try again.' ) ; } }
Remove the specified resource from storage.
Remove the specified resource from storage .
// dd('destroy method', $articleId); // function : get correct article and its id // reason : used for finding correct article to delete/destroy // dd(Articles::where('id', $articleId)->get()); // - in case on error/exception do these things