想要以新文件名克隆消息頁面。Laravel MethodNotAllowedHttpException RouteCollection.php 233行:
mynewmassagepage.blade.php
@extends('master.main')
@section('main-content')
@component('master.notification')
@slot('size')
col-md-8 col-md-offset-2
@endslot
@slot('title')
Send new message
@endslot
@if(session()->has('errormessage'))
<div class="alert alert-danger">
<strong>Whoops ! </strong><span>{{session()->get('errormessage')}}</span>
</div>
@endif
<form class="" action="{{route('sendmessagepost')}}" method="post">
<div class="form-group">
<label for="recipient">Recipient:</label>
<input type="text" name="recipient" id="recipient" value="@if($recipient !== null){{$recipient->username}}@endif" class="form-control">
</div>
<div class="form-group">
<label for="title">Title:</label>
<input type="text" name="title" id="title" value="{{old('title')}}" class="form-control">
</div>
<div class="form-group">
<label for="text">Text:</label>
<textarea name="text" class="form-control" style="resize:none" rows="8" cols="80">{{old('text')}}</textarea>
</div>
<div class="form-group">
<center>
<button type="submit" name="button" class="btn btn-success">Send Message</button>
</center>
</div>
{{csrf_field()}}
</form>
@endcomponent
@stop
在web.php我用這個代碼:
Route::get('mynewmassagepage}','[email protected]')->name('sendmessage');
Route::post('mynewmassagepage','[email protected]')->name('sendmessagepost');
我總是在RouteCollection.php線
MethodNotAllowedHttpException 233:
錯誤返回。我不知道我不是正確的,這是我的第一個laravel項目。
你可以添加一些解釋? *爲什麼*這能解決問題? – wally