Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kk_james's avatar

image source not readable

guys i have a file called create.blade.php with a form with input entry and an entry for uploading an image, when i fill the entry and upload the image and hit enter i get an error that image source not readable

and when i hit enter, i get an error that

The GET method is not supported for this route. Supported methods: POST.

here is my create file

@extends('layouts.app')

@section('content')

<form action="/post" enctype="multipart/form-data" method="POST">

    @csrf;

    <div class="row">

        <div class="col-9 offset-2">

        <h1>Add New post</h1>

        </div>

    </div>

    <div class="row mb-3">

        <div class="col-9 offset-2">
            
            <label for="caption" class="col-md-4 col-form-label">post caption</label>

            <div class="col-md-6">

                <input id="caption" type="text" class="form-control @error('caption') is-invalid @enderror" name="caption" value="{{ old('caption') }}" autocomplete="caption" autofocus>

                @error('caption')

                    <span class="invalid-feedback" role="alert">

                        <strong>{{ $message }}</strong>

                    </span>

                @enderror
        
            </div>
        </div>

    </div>

    <div class="row mt-3">

        <div class="col-9 offset-2">

            <label for="image" class="col-form-label">image</label>

            <input type="file" name="image" class="form-control-file" id="image"> 

            @error('image')

                <span class="invalid-feedback" role="alert">

                    <P>{{ $message }}</P>

                </span>

            @enderror
                
        </div>

    </div>

    <div class="row mt-3">

        <div class="col-lg-9 offset-2">

            <input type="submit" class="btn btn-primary" value="add new post">

        </div>

    </div>

</form>

@endsection

here is my web.php

0 likes
4 replies
kk_james's avatar

@tisuchi <?php // use Illuminate\Support\Facades\Auth; // use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Auth; // use Illuminate\Routing\Route; use Illuminate\Support\Facades\Route;

Route::get('/',function(){ return view('welcome'); });

Auth::routes();

Route::get('/post/create','App\Http\Controllers\PostsController@create');

Route::post('/post','App\Http\Controllers\PostsController@store');

Route::get('/post/{post}','App\Http\Controllers\PostsController@show');

Route::get('/profile/{user}','App\Http\Controllers\ProfilesController@index')->name('profile.show');

Route::get('/profile/{user}/edit','App\Http\Controllers\ProfilesController@edit')->name('profile.edit');

Route::patch('/profile/{user}','App\Http\Controllers\ProfilesController@update')->name('profile.update');

Please or to participate in this conversation.