简体   繁体   中英

Laravel PhpStorm autocomplete

I am having problems with autocompletion in PhpStorm using Laravel. I have set up the IDE accordingly from this guide:

https://confluence.jetbrains.com/display/PhpStorm/Laravel+Development+using+PhpStorm

I cannot autocomplete basic functions like Input::only or Input::has . The closest answer I can find is in this thread:

Laravel Intellisense / autocomplete with PhpStorm

However, Input is already added as alias in config/app.php - still not working.

Anyone experienced same problem and/or know a solution to this?

EDIT:

Sorry for not providing code example - it's only been some Laravel trial and error, but here goes:

I have the route:

Route::post('/login', 'LoginController@authenticate');

In the action of the controller I have tried the following:

 <?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Input;

class LoginController extends Controller
{
   public function authenticate(Request $request) {

       Input::get(); // <-- autocompletes
       Input::has(); // <-- NO autocomplete

       $request->only(); // <-- autocompletes
       $request->validate(); // <-- NO autocomplete

   }
}

use laravel ide-helper package

it can provide accurate autocompletion . Generation is done based on the files in your project.

phpstrom support auto-complete best thing is that

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM