ekvedaras / laravel-query-intellij

💿 Laravel Query Builder integration for PhpStorm
MIT License
47 stars 3 forks source link

Plugin not working correctly with aliases (select, join, orderBy) #81

Open CristianSitov opened 2 years ago

CristianSitov commented 2 years ago

If having a model Profile like:

<?php

namespace App\Models;

use App\Model;
use Eloquent;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
 * @package App\Models
 * @mixin Eloquent
 */
class City extends Model
{
    public function state(): BelongsTo
    {
        return $this->belongsTo(State::class);
    }
}

Then highlighting would look like the screenshot below:

CleanShot 2022-02-22 at 13 22 38@2x
ekvedaras commented 2 years ago

Thank you, will try to reproduce 🙂

ekvedaras commented 2 years ago

Ok I think the issue is with AS instead of as. Not sure how I missed that case 😀 Will add support for AS 🙂

ekvedaras commented 2 years ago

Fixed autocomplete, but something is still off with inspection. Will take a look again 🙂

ekvedaras commented 2 years ago

Fixed in v3.0.3

RobinBastiaan commented 11 months ago

I still have the problem when using a raw DB statement. See the example code below where the column "date" is not found as the parameter of orderBy.

Example code:

City::query()
->select([DB::raw('DISTINCT(DATE(IFNULL(cities.start, cities.end))) as date')])
->orderBy('date');

Should I make a new issue for this? Thank you very much for your time and your plugin.