Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Noriu edit formoje isvesti duomenis, kad galima butu editingi userio data
- Mano forma:
- @foreach ($users as $user)
- {{ Form::model($user, array('route' => array('user.edit', $user->id)))}}
- {{ Form::label('first_name', 'First Name', ['class' => '']) }}
- {{ Form::text('first_name') }}
- {{ Form::label('last_name', 'Last Name', ['class' => '']) }}
- {{ Form::text('last_name') }}
- {{ Form::label('partner', 'What are you?', ['class' => '']) }}
- {{ Form::select('size', ['L' => 'Large', 'S' => 'Small'], null, ['placeholder' => 'Pick a partner...'])}}
- {{ Form::label('email', 'Email', ['class' => '']) }}
- {{ Form::text('email') }}
- {{ Form::label('paypal_email', 'Paypal email', ['class' => '']) }}
- {{ Form::text('paypal_email') }}
- {{ Form::label('referal_id', 'Referral ID', ['class' => '']) }}
- {{ Form::text('referal_id') }}
- {!! csrf_field() !!}
- {!! Form::close() !!}
- @if($errors->any())
- @foreach($errors->all() as $error)
- <div class="alert alert-danger">
- <strong>Error!</strong> {{$error}}
- </div>
- @endforeach
- @endif
- @endforeach
- Gaunu:
- Undefined variable: users
- Routes: Route::post('/account', 'UserController@edit')->name('user.edit');
- UserController@edit:
- public function edit($id)
- {
- return view('account.index', ['user' => User::findOrFail($id)]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement