app/Http/Controllers/Admin/RoleController.php
/**
     * Show the form for editing the specified resource.
     *
     * @param  \App\Role  $role
     * @return \Illuminate\Http\Response
     */
Show the form for editing the specified resource.
Show the form for editing the specified resource .
public function edit($id)
    {      
        $permission=array();
        $menulist= Adminmenu::wherenull('parentid')->with('children')->get();
        $role= Role::find($id);
        if($role){
            if(!empty($role->permission)){
                $permission=explode(",",$role->permission);
            }
            return view('admin.roles.edit',compact('role','menulist','permission','id'));
        }else{
            return redirect()->action('Admin\RoleController@index')->with('failed', 'Record not found.');
        }
    }
public function edit ( $ id ) { $ permission = array ( ) ; $ menulist = Adminmenu :: wherenull ( 'parentid' ) -> with ( 'children' ) -> get ( ) ; $ role = Role :: find ( $ id ) ; if ( $ role ) { if ( ! empty ( $ role -> permission ) ) { $ permission = explode ( " , " , $ role -> permission ) ; } return view ( 'admin.roles.edit' , compact ( 'role' , 'menulist' , 'permission' , 'id' ) ) ; } else { return redirect ( ) -> action ( 'Admin\RoleController@index' ) -> with ( 'failed' , 'Record not found.' ) ; } }
Show the form for editing the specified resource.
Show the form for editing the specified resource .