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
@Nicorjs
Copy link

Nicorjs commented Oct 12, 2019

Laravel / Lumen ^6.0.
works fine ❤️

@wmss-wj
Copy link

wmss-wj commented Jan 16, 2020

❤️

@pcg92
Copy link

pcg92 commented Mar 28, 2020

❤️

@abekerman-dev
Copy link

You're my hero, you saved my day @mchoiruln!

@kito-boy
Copy link

kito-boy commented Oct 16, 2020

@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