您好我是Laravel的新手,我正在开发一个用于发布的创建表单,用户可以使用laravel创建一个博客帖子,但是当我尝试创建帖子时,我一直都会收到错误:
Call to a member function getClientOriginalExtension() on null
这是我的表格:
@extends('master')
@section('content')
<h1>Selling your Home?</h1>
<form action="/flyers" enctype="multpart/form-data" method="post" >
@inject('countries','App\Http\Utilities\Country')
<div class="row">
<div class="col-md-6 form-signin">
{{csrf_field()}}
<div class="form-group">
<label for="street">Street:</label>
<input type="text" name="street" id="street" class="form-control" value="{{old('street')}}" required>
</div>
<div class="form-group">
<label for="city">City:</label>
<input type="text" name="city" id="city" class="form-control" value="{{old('city')}}" required>
</div>
<div class="form-group">
<label for="zip">Zip/ Postal Code:</label>
<input type="text" name="zip" id="zip" class="form-control" value="{{old('zip')}}" required>
</div>
<div class="form-group">
<label for="country">Country:</label>
<select id="country" name="country" class="form-control" required>
@foreach($countries::all() as $country=>$code)
<option value="{{$code}}">{{$country}}</option>
@endforeach
</select>
</div>
<div class="form-group">
<label for="country">State</label>
<input type="text" name="state" id="state" class="form-control" value="{{old('state')}}" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="price">Sale Price:</label>
<input type="text" name="price" id="price" class="form-control" value="{{old('price')}}">
</div>
<div class="form-group">
<label for="description">Home Description:</label>
<textarea name="description" id="description" class ="form-control" cols="30" rows="10" value="{{old('description')}}"></textarea>
</div>
</div>
<div class="col-md-12">
<hr>
<div class="form-group">
<button type="submit" class="btn btn-primary">Create Flyer</button>
</div>
</div>
</div>
</form>
@endsection
答案 0 :(得分:0)
你错过了一个&#39; i&#39;在您的代码上:
应为:import { BrowserRouter as Router , Route, Switch} from 'react-router-dom'
&#34;
而不是:
<ReactRouter.Route path="/" component={App}/>