mardi 5 février 2019

Laravel showing error Too few arguments to function App\Http\Controllers\UserController::admin_side_update(), 1 passed and exactly 2 expected

I made a function other than resource and I am trying to update my data and the update page is showing error. I am solving this error I tried to resolve but i am unable to find way to pass second variable Error Page Image

Edit.blade.php

    @extends('home')

@section('title', '| Edit User')

@section('dashboard')

<div class='col-lg-4 col-lg-offset-4'>

    <h1><i class='fa fa-user-plus'></i> Edit </h1>
    <hr>

     <form action="" method="post" enctype="multipart/form-data">
      

    <div class="form-group">
        <label for="name" class="col-sm-2 col-form-label">Name *</label>

            <input type="text" class="form-control col-sm-10" id="name" name="name"
             value="" />
    </div>


    <div class="form-group">
        <label for="email" class="col-sm-2 col-form-label">Email *</label>

            <input type="email" class="form-control col-sm-10" id="email" name="email"
             value="" />
    </div>


    <h5><b>Give Role</b></h5>

    <div class='form-group'>
        @foreach ($roles as $role)
            <input class="form-check-input" type="checkbox" name="roles[]" value="">  
  <label class="form-check-label" for="defaultCheck1">
    
  </label>
        @endforeach
    </div>

    <div class="form-group">
       <label for="password" class="col-sm-2 col-form-label">Password *</label>

            <input type="password" class="form-control col-sm-10" id="password" name="password"
            value="" />

    </div>

    <div class="form-group row"  style="margin:5%;">

            <button type="submit" class="btn btn-primary col-sm-3 col-sm-offset-3">Edit User</button>
      </div>
  </form>


</div>

@endsection

Web.php

    Route::get('users/{id}/change' ,'UserController@admin_side_edit');
Route::post('users/savechanges', [
    'as' => 'users.updated',
    'uses' => 'UserController@admin_side_update'

This is causing me the error if someone would please help me.



from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2DdBNjl
via IFTTT

Aucun commentaire:

Enregistrer un commentaire