Skip to content

Instantly share code, notes, and snippets.

@mchoiruln
Last active March 8, 2021 17:46
Show Gist options
  • Save mchoiruln/819e59f99e8812e25a282e74fc471e01 to your computer and use it in GitHub Desktop.
Save mchoiruln/819e59f99e8812e25a282e74fc471e01 to your computer and use it in GitHub Desktop.
PHPStorm complaints and solutions (Laravel 5.7 Projects)

Undefined variable $router

where : inside routes\web.php
solution : just add this comment on top that code or top of file after <?php

<?php
/** @var \Laravel\Lumen\Routing\Router $router */
$router->get('/', function () use ($router) {
    return $router->app->version();
});

... other route code
@jtz-ar
Copy link

jtz-ar commented Mar 8, 2021

<3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment