post_name }} id}") }}" method="POST"> {{ csrf_field() }} {{ method_field('DELET..." /> post_name }} id}") }}" method="POST"> {{ csrf_field() }} {{ method_field('DELET..." /> post_name }} id}") }}" method="POST"> {{ csrf_field() }} {{ method_field('DELET..."> post_name }} id}") }}" method="POST"> {{ csrf_field() }} {{ method_field('DELET...">
如果要前面都有絕對網址,可以用url()這個涵數來使用
@foreach ($posts as $post)
{{ $post->id .".". $post->post_name }}
@endforeach
其中就是這一句
{{ url("/todo/{$post->id}") }}
它就可以幫你產生成
http://127.0.0.1:8000/todo/3
這樣的網址
詳細請參考
https://laravel.com/docs/5.8/urls
想對外分享這則貼文嗎?運用網址更方便呦~