create.blade.php 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. @extends('admin/public/layout')
  2. @section('title')
  3. 新建用户
  4. @endsection
  5. @section('content')
  6. <section class="content-header">
  7. <h1>
  8. 新建用户
  9. <small>添加新用户</small>
  10. </h1>
  11. <ol class="breadcrumb">
  12. <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
  13. <li><a href="#">Tables</a></li>
  14. <li class="active">Simple</li>
  15. </ol>
  16. </section>
  17. <section class="content">
  18. <div class="row">
  19. <div class="col-xs-12">
  20. @include('admin/public/error')
  21. <div class="box box-default">
  22. <form role="form" name="userForm" method="POST" action="{{ route('admin.user.store') }}">
  23. <input type="hidden" name="_token" value="{{ csrf_token() }}">
  24. <div class="box-body">
  25. <div class="form-group @if ($errors->has('name')) has-error @endif">
  26. <label>用户名</label>
  27. <input type="text" name="name" class="form-control " placeholder="用户名" value="{{ old('name') }}">
  28. @if ($errors->has('name')) <p class="help-block">{{ $errors->first('name') }}</p> @endif
  29. </div>
  30. <div class="form-group @if ($errors->has('email')) has-error @endif">
  31. <label>邮箱</label>
  32. <input type="email" name="email" class="form-control" placeholder="邮箱" value="{{ old('email') }}">
  33. @if ($errors->has('email')) <p class="help-block">{{ $errors->first('email') }}</p> @endif
  34. </div>
  35. <div class="form-group @if ($errors->has('password')) has-error @endif">
  36. <label>密码</label>
  37. <input type="text" name="password" class="form-control" placeholder="密码" value="{{ old('password','') }}">
  38. @if ($errors->has('password')) <p class="help-block">{{ $errors->first('password') }}</p> @endif
  39. </div>
  40. <div class="form-group">
  41. <label>角色</label>
  42. <select class="form-control" name="role_id">
  43. @foreach( $roles as $role )
  44. <option value="{{ $role->id }}" @if($role->id ==2) selected @endif > {{ $role->name }}</option>
  45. @endforeach
  46. </select>
  47. </div>
  48. </div>
  49. <div class="box-footer">
  50. <button type="submit" class="btn btn-primary">保存</button>
  51. </div>
  52. </form>
  53. </div>
  54. </div>
  55. </div>
  56. </section>
  57. @endsection
  58. @section('script')
  59. <script type="text/javascript">
  60. set_active_menu('manage_user',"{{ route('admin.user.index') }}");
  61. </script>
  62. @endsection