tka-demon
tka-demon

Reputation: 1

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

   }
}

Upvotes: 0

Views: 2191

Answers (1)

Jignesh Joisar
Jignesh Joisar

Reputation: 15175

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

Upvotes: 2

Related Questions