Skip to content

Auxiliary Features

David Rodrigues edited this page Dec 17, 2017 · 9 revisions

Eloquent: Query Scopes support

Laravel Insight can provides some auxiliary features to work with the concept of query scopes implemented by Laravel Framework.

It recognizes only scopes declared inside a child of Eloquent\Model.

Reading context

  • Scope declaration is like public function scopeFilterByAge($builder, $age);
  • Scoped method is like $user->filterByAge(18);

Features

  • It supports code completion, then it will recognize scope declarations as methods available on models;
  • By ctrl+clicking on a scoped method the editor moves to scope declaration;

Blade: folding support

Laravel have your own template engine, called Blade. It offer some statements that have start and end, as @if and @endif. Unfortunatelly, PhpStorm have no native support to folding that. But now it is possible.

Important: the last PhpStorm EAP now supports some statements natively. As in 0.3.2, this plugin still will handle the following statements: @else, @isset, @empty, @for, @foreach, @while, @section, @component, @slot, @verbatim, @php and @push.

image

Features

  • Support basically all foldable statements allowed on Blade (eg. @if, @for, @while, so on);
  • Support continuous statements types (eg. fold from @if to @else, then from @else to @endif);
  • Support to multiline Blade comments (eg. {{-- multi \n line --}}) (FR #WI-39264).
Clone this wiki locally