1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 15:14:04 +00:00

Merge branch 'telescope-tags' of github.com:stancl/tenancy into telescope-tags

This commit is contained in:
Samuel Štancl 2019-08-17 22:31:56 +02:00
commit 8256bf3d6b

View file

@ -49,7 +49,7 @@ class TenancyServiceProvider extends ServiceProvider
$this->app->register(TenantRouteServiceProvider::class); $this->app->register(TenantRouteServiceProvider::class);
if (class_exists(Telescope::class)) { if (\class_exists(Telescope::class)) {
$this->setTelescopeTags(); $this->setTelescopeTags();
} }
} }
@ -60,12 +60,12 @@ class TenancyServiceProvider extends ServiceProvider
Telescope::tag(function (\Laravel\Telescope\IncomingEntry $entry) use ($original_callback) { Telescope::tag(function (\Laravel\Telescope\IncomingEntry $entry) use ($original_callback) {
$tags = []; $tags = [];
if (! is_null($original_callback)) { if (! \is_null($original_callback)) {
$tags = $original_callback($entry); $tags = $original_callback($entry);
} }
if (in_array('tenancy', request()->route()->middleware())) { if (\in_array('tenancy', request()->route()->middleware())) {
$tags = array_merge($tags, ['tenant:' . tenant('uuid')]); $tags = \array_merge($tags, ['tenant:' . tenant('uuid')]);
} }
return $tags; return $tags;