Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
CristianSitov opened this issue Feb 22, 2022 · 5 comments
Open
Labels
bug Something isn't working

Comments

@CristianSitov
Copy link

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 ekvedaras added the bug Something isn't working label Feb 22, 2022
@ekvedaras
Copy link
Owner

Thank you, will try to reproduce 🙂

@ekvedaras
Copy link
Owner

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

@ekvedaras
Copy link
Owner

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

@ekvedaras
Copy link
Owner

Fixed in v3.0.3

@RobinBastiaan
Copy link

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.

@ekvedaras ekvedaras reopened this Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants