diff --git a/app/Models/GithubApp.php b/app/Models/GithubApp.php index 99eb5b575..df76efcf5 100644 --- a/app/Models/GithubApp.php +++ b/app/Models/GithubApp.php @@ -2,11 +2,15 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Casts\Attribute; + class GithubApp extends BaseModel { protected $fillable = ['name', 'uuid', 'organization', 'api_url', 'html_url', 'custom_user', 'custom_port', 'team_id']; + protected $appends = ['type']; protected $casts = [ 'is_public' => 'boolean', + 'type' => 'string' ]; protected static function booted(): void { @@ -25,6 +29,16 @@ class GithubApp extends BaseModel { return $this->belongsTo(PrivateKey::class); } + public function type(): Attribute + { + return Attribute::make( + get: function () { + if ($this->getMorphClass() === 'App\Models\GithubApp') { + return 'github'; + } + }, + ); + } static public function public() { return GithubApp::where('team_id', session('currentTeam')->id)->where('is_public', true)->get(); diff --git a/resources/views/components/magic-bar.blade.php b/resources/views/components/magic-bar.blade.php index e1fac8f3b..7bade0bbe 100644 --- a/resources/views/components/magic-bar.blade.php +++ b/resources/views/components/magic-bar.blade.php @@ -190,6 +190,30 @@ + {{-- Sources --}} + + + + + + + No Source found. Click here to add a new one! + + + + + Jump + + + + + +