Php 拉维路径法问题 基本信息

Php 拉维路径法问题 基本信息,php,html,laravel,Php,Html,Laravel,我正在使用Laravel6.0开发一个简单的Web应用程序。 我在我的create2.blade.php(blade文件)文件中制作了图像发布表单。 但是我的表单似乎有一个路由问题 问题 我的密码 routes/web.php 我用 $composer dump-autoload $php artisan clear-compiled $php artisan optimize $php artisan config:cache 我用这个命令更新我的作曲家 $composer updat

我正在使用Laravel6.0开发一个简单的Web应用程序。
我在我的create2.blade.php(blade文件)文件中制作了图像发布表单。
但是我的表单似乎有一个路由问题

问题

我的密码 routes/web.php 我用

$composer dump-autoload
$php artisan clear-compiled
$php artisan optimize
$php artisan config:cache
我用这个命令更新我的作曲家

$composer update

但一切都没有改变

对不起,我的英语很糟糕。
等待您的评论和回答

您正在使用
POST
方法将from提交到
{{url('/')}
,这意味着它是作为
POST
提交到
//code>路由,并且您的
//code>路由是由
web.php
中的
GET
方法定义的,这就是您收到此错误的原因

<form action="{{ url('/') }}" method="POST" enctype="multipart/form-data">

Route::get('/', 'StoriesController@index');

路由::获取('/','StoriesController@index');

谢谢您回答我的问题。我修改了代码,错误信息消失了。但出现了新的问题。我的发帖单坏了。我的代码中有什么问题吗?@TakamasaYoshizawa提交后是否有任何错误?。另外,请分享您的更新代码。是的,没有错误消息,但我的张贴表单无法正常工作。它无法发布图像。我更新我的代码。(web.php)你能分享
StoriesController@index
code我在我的问题上添加了
index2.blade.php
@extends('layouts.front2')
@section('title','mainpage')

@section('content')
<div class="profile">

    <div class="profileimg">
        @foreach ($images as $image)
        <img src="/storage/{{ $image->path . $image->name }}" style="height: 210px; width: 210px; border-radius: 50%;">
        @endforeach
    </div>

    <div class="name">
        @guest
        <a class="nav-link2" href="{{ route('register')}}">{{ __('Create Accout!')}}</a>
        @else
        <a id="navbarDropdown" class="nav-link2" href="#" role="button">
            {{Auth::user()->name}}<span class="caret"></span></a>



        <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
            @csrf
        </form>
    </div>
    @endguest


    <div class="aboutme">
        You can write your profile here!You can write your profile here!You can write your profile here!
        You can write your profile here!You can write your profile here!You can write your profile here!
        You can write your profile here!You can write your profile here!You can write your profile here!
        You can write your profile here!You can write your profile here!You can write your profile here!
        You can write your profile here!You can write your profile here!You can write your profile here!
    </div>

</div>

<div class="new">

    <div class="newtitle">
        <h1>New</h1>
    </div>

    <div class="container1">

        @foreach ($images as $image)
        <img src="/storage/{{ $image->path . $image->name }}" class="images" style="height: 150px; width: 150px; border-radius: 50%;">
        @endforeach
        <div class="more">
            more...
        </div>
    </div>

</div>

<div class="stories">

    <div class="titlestories">
        <h1>Stories</h1>
    </div>

    <div class="container2">

        <div class="titleclose">
            <h2>#CloseFriends</h2>
        </div>

        @foreach ($images as $image)
        <img src="/storage/{{ $image->path . $image->name }}" class="images" style="height: 150px; width: 150px; border-radius: 50%;">
        @endforeach

        <div class="titlefollow">
            <h2>#Follows</h2>
        </div>


    </div>
</div>

{{ csrf_field() }}
@endsection
$php artisan route: clear
$composer dump-autoload
$php artisan clear-compiled
$php artisan optimize
$php artisan config:cache
$composer update
<form action="{{ url('/') }}" method="POST" enctype="multipart/form-data">

Route::get('/', 'StoriesController@index');