form.blade.php 731 B

123456789101112131415161718192021222324
  1. @extends ('layout')
  2. @section ('content')
  3. <form method='POST' action='{{ isset($post) ? route("cntrl.update", [$post['id']]) : route("cntrl.store") }}'>
  4. @csrf
  5. @if (isset($post))
  6. @method('put')
  7. @endif
  8. <input type='text' name='title' placeholder='Title' value='{{$post['text'] ?? ''}}'/><br/>
  9. <textarea name='text' placeholder='text'>{{$post['title'] ?? ''}}</textarea><br/>
  10. <select multiple size='3' name='tags[]'>
  11. @foreach($allTags as $tag)
  12. <option value='{{ $tag['id']}}'
  13. {{ array_search( $tag['id'],$postTags) > -1 ? "selected" : "" }}>{{ $tag['tag']}} </option>
  14. @endforeach
  15. </select>
  16. <input type='submit' />
  17. </form>
  18. @endsection
  19. @section ('title')
  20. create
  21. @endsection