Skip to content

Commit

Permalink
Implement suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
lieselwd committed Oct 28, 2024
1 parent a662997 commit c35a04f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/ClxMessagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function showRclMessage(RclMessage $rclMessage)

return view('controllers.clx.rcl-messages.show', [
'message' => $rclMessage,
'dlAuthorities' => DatalinkAuthority::whereSystem(false)->get(),
'dlAuthorities' => DatalinkAuthority::notSystem()->get(),
'tracks' => $rclMessage->is_concorde ? Track::concorde()->get() : Track::active()->get(),
'activeDlAuthority' => $this->dataService->getActiveControllerAuthority(Auth::user()) ?? DatalinkAuthority::find('NAT'),
'_pageTitle' => $rclMessage->callsign,
Expand Down
7 changes: 7 additions & 0 deletions app/Models/DatalinkAuthority.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Models;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;

/**
Expand All @@ -26,6 +27,7 @@
* @method static \Illuminate\Database\Eloquent\Builder|DatalinkAuthority whereSystem($value)
* @method static \Illuminate\Database\Eloquent\Builder|DatalinkAuthority whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|DatalinkAuthority whereValidRclTarget($value)
* @method static Builder|DatalinkAuthority notSystem()
* @mixin \Eloquent
*/
class DatalinkAuthority extends Model
Expand All @@ -46,4 +48,9 @@ class DatalinkAuthority extends Model
];

protected $keyType = 'string';

public function scopeNotSystem(Builder $query): Builder
{
return $query->where('system', false);
}
}

0 comments on commit c35a04f

Please sign in to comment.