|
@@ 89-108 (lines=20) @@
|
| 86 |
|
$grid->slug(trans('admin.slug')); |
| 87 |
|
$grid->name(trans('admin.name')); |
| 88 |
|
|
| 89 |
|
$grid->http_path(trans('admin.route'))->display(function ($path) { |
| 90 |
|
return collect(explode("\r\n", $path))->map(function ($path) { |
| 91 |
|
$method = $this->http_method ?: ['ANY']; |
| 92 |
|
|
| 93 |
|
if (Str::contains($path, ':')) { |
| 94 |
|
list($method, $path) = explode(':', $path); |
| 95 |
|
$method = explode(',', $method); |
| 96 |
|
} |
| 97 |
|
|
| 98 |
|
$method = collect($method)->map(function ($name) { |
| 99 |
|
return strtoupper($name); |
| 100 |
|
})->map(function ($name) { |
| 101 |
|
return "<span class='label label-primary'>{$name}</span>"; |
| 102 |
|
})->implode(' '); |
| 103 |
|
|
| 104 |
|
$path = '/'.trim(config('admin.route.prefix'), '/').$path; |
| 105 |
|
|
| 106 |
|
return "<div style='margin-bottom: 5px;'>$method<code>$path</code></div>"; |
| 107 |
|
})->implode(''); |
| 108 |
|
}); |
| 109 |
|
|
| 110 |
|
$grid->created_at(trans('admin.created_at')); |
| 111 |
|
$grid->updated_at(trans('admin.updated_at')); |
|
@@ 136-155 (lines=20) @@
|
| 133 |
|
$show->slug(trans('admin.slug')); |
| 134 |
|
$show->name(trans('admin.name')); |
| 135 |
|
|
| 136 |
|
$show->http_path(trans('admin.route'))->as(function ($path) { |
| 137 |
|
return collect(explode("\r\n", $path))->map(function ($path) { |
| 138 |
|
$method = $this->http_method ?: ['ANY']; |
| 139 |
|
|
| 140 |
|
if (Str::contains($path, ':')) { |
| 141 |
|
list($method, $path) = explode(':', $path); |
| 142 |
|
$method = explode(',', $method); |
| 143 |
|
} |
| 144 |
|
|
| 145 |
|
$method = collect($method)->map(function ($name) { |
| 146 |
|
return strtoupper($name); |
| 147 |
|
})->map(function ($name) { |
| 148 |
|
return "<span class='label label-primary'>{$name}</span>"; |
| 149 |
|
})->implode(' '); |
| 150 |
|
|
| 151 |
|
$path = '/'.trim(config('admin.route.prefix'), '/').$path; |
| 152 |
|
|
| 153 |
|
return "<div style='margin-bottom: 5px;'>$method<code>$path</code></div>"; |
| 154 |
|
})->implode(''); |
| 155 |
|
}); |
| 156 |
|
|
| 157 |
|
$show->created_at(trans('admin.created_at')); |
| 158 |
|
$show->updated_at(trans('admin.updated_at')); |