Maybe solved PhpStorm problems with Schema and \Illuminate\Support\Fluent\ for nullable, index, unsigned, etc
I was having troubles using the Blueprint Class on migrations, I was constantly having warnings using something like this:
//there is no autocompletion after string("foo") and warning in nullable
$table->string("foo")->nullable()->index();
// there is no autocompletion after integer("bar") and warning in unsigned
$table->integer("bar")->unsigned();
I hadn't found any proper solution, some people was saying they didn't had that problem, but based on this link http://stackoverflow.com/a/32811541 and with little modifications I added this to the very end of my _ide-helper.php file ( right after the last curly brace ) and every thing started to work.
namespace Illuminate\Support{
/**
* @method Fluent first()
* @method Fluent after($column)
* @method Fluent change()
* @method Fluent nullable()
* @method Fluent unsigned()
* @method Fluent unique()
* @method Fluent index()
* @method Fluent primary()
* @method Fluent default($value)
* @method Fluent onUpdate($value)
* @method Fluent onDelete($value)
* @method Fluent references($value)
* @method Fluent on($value)
*/
class Fluent {}
}
I also removed this code at the top of my migrations and Schema went back to run smoothly without warnings and autocompletion.
use Illuminate\Support\Facades\Schema;
I also opened an Issue hoping this to be included as default by ide-helper. https://github.com/barryvdh/laravel-ide-helper/issues/425
Well, hope you find this useful;
Please or to participate in this conversation.