E
E
Eugene2019-03-27 22:22:00
Laravel
Eugene, 2019-03-27 22:22:00

Laravel 5.8 only changes controller after composer upgrade. Is that how it should be?

I'm learning laravel, I ran into a problem with displaying information on pages through controllers.
In the web.php file, the route for the page
Route::get('/', '[email protected]');
. There are 2 methods in the controller: index (main) and hello (test).
After changing the method, I refresh the page and ... nothing happens. Changes are only applied after the "composer upgrade" command.
I'm watching video tutorials and I can't figure out what's wrong.
php artisan serve is running.
web.php IndexController
Route::get('/', '[email protected]');
content

<?php

namespace App\Http\Controllers;
use Illuminate\Http\Request;

use App\News_Posts;

class IndexController extends Controller
{
    
    public function index() {

        $news = 'It`s title news';
        return view('home_page.home_page')->with('news', $news);

    }

    public function hello(){
       $news = 'It`s title news hello';
        return view('home_page.home_page')->with('news', $news);
    }

}

The problem is that without the composer upgrade command, the changes in web.php are not applied.
For example, you need to change the index controller
Route::get('/', '[email protected]');
method to the hello method .
Route::get('/', '[email protected]');
After saving, you need to go to the console and perform an update

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jedi, 2019-03-27
@PHPjedi

Little information... Where is the code?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question