Plugin not working correctly with aliases (select, join, orderBy)
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:
Thank you, will try to reproduce 🙂
Ok I think the issue is with AS instead of as. Not sure how I missed that case 😀 Will add support for AS 🙂
Fixed autocomplete, but something is still off with inspection. Will take a look again 🙂
Fixed in v3.0.3
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.