Commit 170e7dc8 authored by m-wynn's avatar m-wynn

viewファイルカスタマイズ

parent 08a9ac1d
<!-- 'Boolean {{ $fieldTitle }} Field' checked by default --> <!-- 'Boolean {{ $fieldTitle }} Field' checked by default -->
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
@if($config->options->localized) @if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!} <label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else @else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!} <label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif @endif
<label class="checkbox-inline"> <label class="checkbox-inline">
@{!! Form::checkbox('{{ $fieldName }}', 1, true) !!} <input type="checkbox" name="{{ $fieldName }}" value="1" checked>
<!-- remove {, true} to make it unchecked by default --> <!-- remove 'checked' attribute to make it unchecked by default -->
</label> </label>
</div> </div>
\ No newline at end of file
<!-- {{ $fieldTitle }} Field --> <!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
<div class="form-check"> <div class="form-check">
@{!! Form::hidden('{{ $fieldName }}', 0, ['class' => 'form-check-input']) !!} <input type="hidden" name="{{ $fieldName }}" value="0" class="form-check-input">
@{!! Form::checkbox('{{ $fieldName }}', '{{ $checkboxVal }}', null, ['class' => 'form-check-input']) !!} <input type="checkbox" name="{{ $fieldName }}" value="{{ $checkboxVal }}" class="form-check-input">
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}', ['class' => 'form-check-label']) !!} <label class="form-check-label" for="{{ $fieldName }}">{{ $fieldTitle }}</label>
</div> </div>
</div> </div>
\ No newline at end of file
<!-- {{ $fieldTitle }} Field --> <!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-12"> <div class="form-group col-sm-12">
@if($config->options->localized) @if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!} <label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else @else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!} <label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif @endif
@if($config->options->localized) @if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!} <label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else @else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!} <label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif @endif
{!! $checkboxes !!} {!! $checkboxes !!}
</div> </div>
\ No newline at end of file
<!-- {{ $fieldTitle }} Field --> <!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
@if($config->options->localized) @if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!} <label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else @else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!} <label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif @endif
@{!! Form::text('{{ $fieldName }}', null, ['class' => 'form-control','id'=>'{{ $fieldName }}']) !!} <input type="text" name="{{ $fieldName }}" class="form-control" id="{{ $fieldName }}">
</div> </div>
@@push('page_scripts') @@push('page_scripts')
<script type="text/javascript"> <script type="text/javascript">
$('#{{ $fieldName }}').datepicker() $('#{{ $fieldName }}').datepicker()
</script> </script>
@@endpush @@endpush
\ No newline at end of file
<!-- {{ $fieldTitle }} Field --> <!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
@if($config->options->localized) @if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!} <label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else @else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!} <label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif @endif
@{!! Form::email('{{ $fieldName }}', null, ['class' => 'form-control'@php if(isset($options)) { echo htmlspecialchars_decode($options); } @endphp]) !!} <input type="email" name="{{ $fieldName }}" class="form-control{{ isset($options) ? htmlspecialchars_decode($options) : '' }}">
</div> </div>
\ No newline at end of file
<!-- {{ $fieldTitle }} Field --> <!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
@if($config->options->localized) @if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!} <label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else @else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!} <label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif @endif
<div class="input-group"> <div class="input-group">
<div class="custom-file"> <div class="custom-file">
@{!! Form::file('{{ $fieldName }}', ['class' => 'custom-file-input']) !!} <input type="file" name="{{ $fieldName }}" class="custom-file-input">
@{!! Form::label('{{ $fieldName }}', 'Choose file', ['class' => 'custom-file-label']) !!} <label class="custom-file-label" for="{{ $fieldName }}">Choose file</label>
</div> </div>
</div> </div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
\ No newline at end of file
<!-- {{ $fieldTitle }} Field --> <!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
@if($config->options->localized) @if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!} <label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else @else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!} <label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif @endif
@{!! Form::number('{{ $fieldName }}', null, ['class' => 'form-control'@php if(isset($options)) { echo htmlspecialchars_decode($options); } @endphp]) !!} <input type="number" name="{{ $fieldName }}" class="form-control{{ isset($options) ? htmlspecialchars_decode($options) : '' }}">
</div> </div>
\ No newline at end of file
<!-- {{ $fieldName }} Field --> <!-- {{ $fieldName }} Field -->
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
@if($config->options->localized) @if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!} <label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else @else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!} <label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif @endif
@{!! Form::password('{{ $fieldName }}', ['class' => 'form-control'@php if(isset($options)) { echo htmlspecialchars_decode($options); } @endphp]) !!} <input type="password" name="{{ $fieldName }}" class="form-control{{ isset($options) ? htmlspecialchars_decode($options) : '' }}">
</div> </div>
\ No newline at end of file
<label class="form-check"> <label class="form-check">
@{!! Form::radio('{{ $fieldName }}', "{{ $value }}", null, ['class' => 'form-check-input']) !!} {{ $label }} <input type="radio" name="{{ $fieldName }}" value="{{ $value }}" class="form-check-input">
</label> {{ $label }}
\ No newline at end of file </label>
<!-- {{ $fieldTitle }} Field --> <!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-12"> <div class="form-group col-sm-12">
@if($config->options->localized) @if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}'), ['class' => 'form-check-label']) !!} <label for="{{ $fieldName }}" class="form-check-label">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}</label>
@else @else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}', ['class' => 'form-check-label']) !!} <label for="{{ $fieldName }}" class="form-check-label">{{ $fieldTitle }}</label>
@endif @endif
{!! $radioButtons !!} {!! $radioButtons !!}
</div> </div>
\ No newline at end of file
<!-- {{ $fieldTitle }} Field --> <!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
@if($config->options->localized) @if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!} <label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else @else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!} <label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif @endif
@{!! Form::select('{{ $fieldName }}', @php echo htmlspecialchars_decode($selectValues) @endphp, null, ['class' => 'form-control custom-select']) !!} <select name="{{ $fieldName }}" class="form-control custom-select">
</div> {!! html_entity_decode($selectValues) !!}
\ No newline at end of file </select>
</div>
<!-- {{ $fieldTitle }} Field --> <!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
@if($config->options->localized) @if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!} <label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else @else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!} <label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif @endif
@{!! Form::text('{{ $fieldName }}', null, ['class' => 'form-control'@php if(isset($options)) { echo htmlspecialchars_decode($options); } @endphp]) !!} <input type="text" name="{{ $fieldName }}" class="form-control{{ isset($options) ? htmlspecialchars_decode($options) : '' }}">
</div> </div>
\ No newline at end of file
<!-- {{ $fieldTitle }} Field --> <!-- {{ $fieldTitle }} Field -->
<div class="form-group col-sm-12 col-lg-12"> <div class="form-group col-sm-12 col-lg-12">
@if($config->options->localized) @if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!} <label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else @else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!} <label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif @endif
@{!! Form::textarea('{{ $fieldName }}', null, ['class' => 'form-control'@php if(isset($options)) { echo htmlspecialchars_decode($options); } @endphp]) !!} <textarea name="{{ $fieldName }}" class="form-control{{ isset($options) ? htmlspecialchars_decode($options) : '' }}"></textarea>
</div> </div>
\ No newline at end of file
<!-- 'bootstrap / Toggle Switch {{ $fieldTitle }} Field' --> <!-- 'bootstrap / Toggle Switch {{ $fieldTitle }} Field' -->
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
<div class="custom-control custom-switch"> <div class="custom-control custom-switch">
@{!! Form::checkbox('{{ $fieldName }}', 1, null, ['class' => 'custom-control-input']) !!} <input type="checkbox" name="{{ $fieldName }}" class="custom-control-input">
@if($config->options->localized) @if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':', ['class' => 'custom-control-label']) !!} <label class="custom-control-label" for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . '.fields.' . $fieldName) }}:</label>
@else @else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:', ['class' => 'custom-control-label']) !!} <label class="custom-control-label" for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif @endif
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -23,22 +23,22 @@ ...@@ -23,22 +23,22 @@
<div class="card"> <div class="card">
@{!! Form::open(['route' => '{{ $config->prefixes->getRoutePrefixWith('.') }}{{ $config->modelNames->camelPlural }}.store']) !!} <form method="post" action="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.store') }}">
@@csrf
<div class="card-body">
<div class="card-body"> <div class="row">
@@include('{{ $config->prefixes->getViewPrefixForInclude() }}{{ $config->modelNames->snakePlural }}.fields')
</div>
<div class="row">
@@include('{{ $config->prefixes->getViewPrefixForInclude() }}{{ $config->modelNames->snakePlural }}.fields')
</div> </div>
</div> <div class="card-footer">
<button type="submit" class="btn btn-primary">Save</button>
<div class="card-footer"> <a href="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.index') }}" class="btn btn-default">@if($config->options->localized) @@lang('crud.cancel') @else Cancel @endif</a>
@{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!} </div>
<a href="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.index') }}" class="btn btn-default">@if($config->options->localized) @@lang('crud.cancel') @else Cancel @endif</a>
</div>
@{!! Form::close() !!} </form>
</div> </div>
</div> </div>
......
...@@ -23,8 +23,9 @@ ...@@ -23,8 +23,9 @@
<div class="card"> <div class="card">
@{!! Form::model(${{ $config->modelNames->camel }}, ['route' => ['{{ $config->prefixes->getRoutePrefixWith('.') }}{{ $config->modelNames->camelPlural }}.update', ${{ $config->modelNames->camel }}->{{ $config->primaryName }}], 'method' => 'patch']) !!} <form method="POST" action="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.update', ${!! $config->modelNames->camel !!}->{!! $config->primaryName !!}) }}">
@@csrf
@@method('PATCH')
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
@@include('{{ $config->prefixes->getViewPrefixForInclude() }}{{ $config->modelNames->snakePlural }}.fields') @@include('{{ $config->prefixes->getViewPrefixForInclude() }}{{ $config->modelNames->snakePlural }}.fields')
...@@ -32,11 +33,11 @@ ...@@ -32,11 +33,11 @@
</div> </div>
<div class="card-footer"> <div class="card-footer">
@{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!} <button type="submit" class="btn btn-primary">Save</button>
<a href="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.index') }}" class="btn btn-default">@if($config->options->localized) @@lang('crud.cancel') @else Cancel @endif</a> <a href="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.index') }}" class="btn btn-default">@if($config->options->localized) @@lang('crud.cancel') @else Cancel @endif</a>
</div> </div>
@{!! Form::close() !!} </form>
</div> </div>
</div> </div>
......
<!-- {{ $fieldTitle }} Field --> <!-- {{ $fieldTitle }} Field -->
<div class="col-sm-12"> <div class="col-sm-12">
@if($config->options->localized) @if($config->options->localized)
@{!! Form::label('{{ $fieldName }}', __('models/{{ $config->modelNames->camelPlural }}.fields.{{ $fieldName }}').':') !!} <label for="{{ $fieldName }}">{{ __('models/' . $config->modelNames->camelPlural . 'fields' . $fieldName) }}:</label>
@else @else
@{!! Form::label('{{ $fieldName }}', '{{ $fieldTitle }}:') !!} <label for="{{ $fieldName }}">{{ $fieldTitle }}:</label>
@endif @endif
<p>@{{ ${!! $config->modelNames->camel !!}->{!! $fieldName !!} }}</p> <p>@{{ ${!! $config->modelNames->camel !!}->{!! $fieldName !!} }}</p>
</div> </div>
\ No newline at end of file
...@@ -16,7 +16,10 @@ ...@@ -16,7 +16,10 @@
<tr> <tr>
{!! $fieldBody !!} {!! $fieldBody !!}
<td style="width: 120px"> <td style="width: 120px">
@{!! Form::open(['route' => ['{{ $config->prefixes->getRoutePrefixWith('.') }}{{ $config->modelNames->camelPlural }}.destroy', ${{ $config->modelNames->camel }}->{{ $config->primaryName }}], 'method' => 'delete']) !!}
<form method="POST" action="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.destroy', ${!! $config->modelNames->camel !!}->{!! $config->primaryName !!}) }}">
@@csrf
@method('DELETE')
<div class='btn-group'> <div class='btn-group'>
<a href="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.show', [${!! $config->modelNames->camel !!}->{!! $config->primaryName !!}]) }}" <a href="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.show', [${!! $config->modelNames->camel !!}->{!! $config->primaryName !!}]) }}"
class='btn btn-default btn-xs'> class='btn btn-default btn-xs'>
...@@ -26,9 +29,11 @@ ...@@ -26,9 +29,11 @@
class='btn btn-default btn-xs'> class='btn btn-default btn-xs'>
<i class="far fa-edit"></i> <i class="far fa-edit"></i>
</a> </a>
@{!! Form::button('<i class="far fa-trash-alt"></i>', ['type' => 'submit', 'class' => 'btn btn-danger btn-xs', 'onclick' => "return confirm('Are you sure?')"]) !!} <button type="submit" class="btn btn-danger btn-xs" onclick="return confirm('Are you sure?')">
<i class="far fa-trash-alt"></i>
</button>
</div> </div>
@{!! Form::close() !!} </form>
</td> </td>
</tr> </tr>
@@endforeach @@endforeach
......
@{!! Form::open(['route' => ['{{ $config->prefixes->getRoutePrefixWith('.') }}{{ $config->modelNames->camelPlural }}.destroy', ${{ $config->primaryName }}], 'method' => 'delete']) !!} <form method="POST" action="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.destroy', {!! $config->primaryName !!}) }}">
@@csrf
@@method('DELETE')
<div class='btn-group'> <div class='btn-group'>
<a href="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.show', ${!! $config->primaryName !!}) }}" class='btn btn-default btn-xs'> <a href="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.show', ${!! $config->primaryName !!}) }}" class='btn btn-default btn-xs'>
<i class="fa fa-eye"></i> <i class="fa fa-eye"></i>
...@@ -6,15 +8,9 @@ ...@@ -6,15 +8,9 @@
<a href="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.edit', ${!! $config->primaryName !!}) }}" class='btn btn-default btn-xs'> <a href="@{{ route('{!! $config->prefixes->getRoutePrefixWith('.') !!}{!! $config->modelNames->camelPlural !!}.edit', ${!! $config->primaryName !!}) }}" class='btn btn-default btn-xs'>
<i class="fa fa-edit"></i> <i class="fa fa-edit"></i>
</a> </a>
@{!! Form::button('<i class="fa fa-trash"></i>', [ <button type="submit" class="btn btn-danger btn-xs" onclick="<?php echo $config->options->localized ? "return confirm('Are you sure?')" : "return confirm('" . __('crud.are_you_sure') . "')"; ?>">
'type' => 'submit', <i class="fa fa-trash"></i>
'class' => 'btn btn-danger btn-xs', </button>
@if($config->options->localized)
'onclick' => "return confirm('Are you sure?')"
@else
'onclick' => 'return confirm("'.__('crud.are_you_sure').'")'
@endif
]) !!}
</div> </div>
@{!! Form::close() !!} </form>
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
<div class="card"> <div class="card">
{!! Form::open(['route' => 'users.store']) !!} <form method="POST" action="@{{ route('users.store') }}">
@@csrf
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
...@@ -26,11 +27,11 @@ ...@@ -26,11 +27,11 @@
</div> </div>
<div class="card-footer"> <div class="card-footer">
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!} <button type="submit" class="btn btn-primary">Save</button>
<a href="{{ route('users.index') }}" class="btn btn-default">Cancel</a> <a href="{{ route('users.index') }}" class="btn btn-default">Cancel</a>
</div> </div>
{!! Form::close() !!} </form>
</div> </div>
</div> </div>
......
...@@ -17,7 +17,9 @@ ...@@ -17,7 +17,9 @@
<div class="card"> <div class="card">
{!! Form::model($user, ['route' => ['users.update', $user->id], 'method' => 'patch']) !!} <form method="POST" action="@{{ route('users.update', {!! $user->id !!}) }}">
@@csrf
@@method('PATCH')
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
...@@ -26,11 +28,11 @@ ...@@ -26,11 +28,11 @@
</div> </div>
<div class="card-footer"> <div class="card-footer">
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!} <button type="submit" class="btn btn-primary">Save</button>
<a href="{{ route('users.index') }}" class="btn btn-default">Cancel</a> <a href="{{ route('users.index') }}" class="btn btn-default">Cancel</a>
</div> </div>
{!! Form::close() !!} </form>
</div> </div>
</div> </div>
......
<!-- Name Field --> <!-- Name Field -->
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
{!! Form::label('name', 'Name') !!} <label for="name">Name</label>
{!! Form::text('name', null, ['class' => 'form-control']) !!} <input type="text" name="name" id="name" class="form-control">
</div> </div>
<!-- Email Field --> <!-- Email Field -->
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
{!! Form::label('email', 'Email') !!} <label for="email">Email</label>
{!! Form::email('email', null, ['class' => 'form-control']) !!} <input type="email" name="email" id="email" class="form-control">
</div> </div>
<!-- Password Field --> <!-- Password Field -->
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
{!! Form::label('password', 'Password') !!} <label for="password">Password</label>
{!! Form::password('password', ['class' => 'form-control']) !!} <input type="password" name="password" id="password" class="form-control">
</div> </div>
<!-- Confirmation Password Field --> <!-- Confirmation Password Field -->
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
{!! Form::label('password', 'Password Confirmation') !!} <label for="password_confirmation">Password Confirmation</label>
{!! Form::password('password_confirmation', ['class' => 'form-control']) !!} <input type="password" name="password_confirmation" id="password_confirmation" class="form-control">
</div> </div>
\ No newline at end of file
<!-- Name Field --> <!-- Name Field -->
<div class="col-sm-12"> <div class="col-sm-12">
{!! Form::label('name', 'Name:') !!} <label for="name">Name:</label>
<p>{!! $user->name !!}</p> <p>{!! $user->name !!}</p>
</div> </div>
<!-- Email Field --> <!-- Email Field -->
<div class="col-sm-12"> <div class="col-sm-12">
{!! Form::label('email', 'Email:') !!} <label for="email">Email:</label>
<p>{!! $user->email !!}</p> <p>{!! $user->email !!}</p>
</div> </div>
...@@ -13,7 +13,9 @@ ...@@ -13,7 +13,9 @@
<td>{!! $user->name !!}</td> <td>{!! $user->name !!}</td>
<td>{!! $user->email !!}</td> <td>{!! $user->email !!}</td>
<td> <td>
{!! Form::open(['route' => ['users.destroy', $user->id], 'method' => 'delete']) !!} <form action="@{{ route('users.destroy', $user->id) }}" method="post">
@@csrf
@@method('DELETE')
<div class='btn-group'> <div class='btn-group'>
<a href="{!! route('users.show', [$user->id]) !!}" class='btn btn-default btn-xs'> <a href="{!! route('users.show', [$user->id]) !!}" class='btn btn-default btn-xs'>
<i class="fa fa-eye"></i> <i class="fa fa-eye"></i>
...@@ -21,9 +23,11 @@ ...@@ -21,9 +23,11 @@
<a href="{!! route('users.edit', [$user->id]) !!}" class='btn btn-default btn-xs'> <a href="{!! route('users.edit', [$user->id]) !!}" class='btn btn-default btn-xs'>
<i class="fa fa-edit"></i> <i class="fa fa-edit"></i>
</a> </a>
{!! Form::button('<i class="fa fa-trash"></i>', ['type' => 'submit', 'class' => 'btn btn-danger btn-xs', 'onclick' => "return confirm('Are you sure?')"]) !!} <button type="submit" class="btn btn-danger btn-xs" onclick="return confirm('Are you sure?')">
<i class="fa fa-trash"></i>
</button>
</div> </div>
{!! Form::close() !!} </form>
</td> </td>
</tr> </tr>
@endforeach @endforeach
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment