app/Http/Controllers/PriceListController.php
/**
     * Remove the specified resource from storage.
     *
     * @param  \App\Models\Users  $Users
     * @return \Illuminate\Http\Response
     */
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy($id)
    {
        $list = PriceList::findOrFail($id);
        $role = $list->role;
        if(Auth::user()->role=='Administrador'){
            PriceList::destroy($id);
            }
        return redirect('/lists?role='.$role)->with('deleteSuccess','Lista eliminada');
    }
public function destroy ( $ id ) { $ list = PriceList :: findOrFail ( $ id ) ; $ role = $ list -> role ; if ( Auth :: user ( ) -> role == 'Administrador' ) { PriceList :: destroy ( $ id ) ; } return redirect ( '/lists?role=' . $ role ) -> with ( 'deleteSuccess' , 'Lista eliminada' ) ; }
Remove the specified resource from storage.
Remove the specified resource from storage .