Screen transition during post processing at Level

Asked 2 years ago, Updated 2 years ago, 79 views

I would like to post with Ravel and transition the screen, but I cannot.
The error details are as follows.

The requested URL/hellow was not found on this server.

I think there are other settings besides the code, but I don't know the cause even if I look into it.
I look forward to your kind cooperation.

index.blade.php

<html>
<head>
    <title>Hello/Index</title>
    <style>
        body {font-size:16pt;color:#999;}
        h1 { font-size: 50pt; text-align:right; color:#f6f6f6;
         margin —20px0px-30px0px; letter-spacing:-4pt;}
    </style>
</head>
<body>
    <h1>Blade/Index</h1>
    <p>{{$msg}}</p>
    <form method="POST" action="/hello">
        {{csrf_field()}}
        <input type="text" name="msg">
        <input type="submit">
    </form>
</body>
</html>

HelloController.php

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Http\Response;

class HelloController extensions Controller
{
    // Action Description
    public function index() {

        $data=['msg'=>'Please enter a name.',
        ];
        return view('hello.index',$data);
    }

    public function post(Request$request){
        $msg = $request->msg;
        $data=['msg'=>'Hello'.$msg.', ];
        return view('hello.index',$data);
    }

}

web.php

<?php

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

Route::get('hello', 'HelloController@index');
Route::post('hello', 'HelloController@post');

laravel

2022-09-30 21:43

1 Answers

Route::get('hello', 'HelloController@index');
Route::post('hello', 'HelloController@post');

Would it be possible to correct as follows?

Route::get('/hello', 'HelloController@index');
Route::post('/hello', 'HelloController@post');


2022-09-30 21:43

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.