edit.blade.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="container">
  4. <form action="/profile/{{ $user->id }}" enctype="multipart/form-data" method="post">
  5. @csrf
  6. @method('PATCH')
  7. <div class="row">
  8. <div class="col-8 offset-2">
  9. <div class="row">
  10. <h1>Edit Profile</h1>
  11. </div>
  12. <div class="form-group row">
  13. <label for="title" class="col-md-4 col-form-label">Title</label>
  14. <input id="title" type="text" class="form-control @error('title') is-invalid @enderror" name="title" value="{{ old('title') ?? $user->profile->title }}" required autocomplete="title" autofocus>
  15. @error('title')
  16. <span class="invalid-feedback" role="alert">
  17. <strong>{{ $message }}</strong>
  18. </span>
  19. @enderror
  20. </div>
  21. <div class="form-group row">
  22. <label for="description" class="col-md-4 col-form-label">Description</label>
  23. <input id="description" type="text" class="form-control @error('description') is-invalid @enderror" name="description" value="{{ old('description') ?? $user->profile->description }}" required autocomplete="description" autofocus>
  24. @error('description')
  25. <span class="invalid-feedback" role="alert">
  26. <strong>{{ $message }}</strong>
  27. </span>
  28. @enderror
  29. </div>
  30. <div class="form-group row">
  31. <label for="url" class="col-md-4 col-form-label">URL</label>
  32. <input id="url" type="text" class="form-control @error('url') is-invalid @enderror" name="url" value="{{ old('url') ?? $user->profile->url }}" required autocomplete="url" autofocus>
  33. @error('url')
  34. <span class="invalid-feedback" role="alert">
  35. <strong>{{ $message }}</strong>
  36. </span>
  37. @enderror
  38. </div>
  39. <div class="row">
  40. <label for="image" class="col-md-4 col-form-label">Profile Image</label>
  41. <input type="file" class="form-control-file" id="image" name="image">
  42. @error('image')
  43. <strong>{{ $message }}</strong>
  44. @enderror
  45. </div>
  46. <div class="row pt-4">
  47. <button class="btn btn-primary">Save Profile</button>
  48. </div>
  49. </div>
  50. </div>
  51. </form>
  52. </div>
  53. @endsection