Skip to content

Commit

Permalink
Remove cp_icon config option
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed Jan 23, 2025
1 parent 3cc15f6 commit 392d4da
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 43 deletions.
17 changes: 0 additions & 17 deletions docs/control-panel.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,6 @@ Technically, you can’t fully disable Runway’s CP feature. However, what you
],
```

## Custom Icon for CP Nav Item

Runway has a rather generic icon for resources in the Control Panel Nav. Feel free to change this to something else that better suits your use case (in fact, I’d encourage it).

You can either provide the name of an existing icon [packaged into Statamic Core](https://github.com/statamic/cms/tree/3.1/resources/svg) or inline the SVG as a string.

```php
// config/runway.php

'resources' => [
\App\Models\Order::class => [
'name' => 'Orders',
'cp_icon' => 'date',
],
],
```

## Permissions

![Screenshot of Runway's User Permissions](/img/runway/cp-user-permissions.png)
Expand Down
15 changes: 0 additions & 15 deletions docs/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,6 @@ If you’d like to hide the CP Nav Item that’s registered for this model, just

> Bear in mind, this will just hide the Nav Item for the CP interface, it won’t actually get rid of the routes being registered. If someone knows where to look, they could still use the CP to manage your models (they could guess the URL).
### Control Panel Icon

You should set `icon` to the name of the icon you’d like to use instead.

Alternatively, if the icon you want isn’t [included in Statamic](https://github.com/statamic/cms/tree/3.1/resources/svg), you can also pass an inline SVG.

```php
'resources' => [
\App\Models\Order::class => [
'name' => 'Orders',
'cp_icon' => 'date',
],
],
```

### Route

If you want to take advantage of Runway’s front-end routing abilities, you can pass in a `route` to enable it.
Expand Down
10 changes: 0 additions & 10 deletions src/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,6 @@ public function config(): Collection
return $this->config;
}

public function cpIcon(): string
{
if (! $this->config->has('cp_icon')) {
return File::get(__DIR__.'/../resources/svg/database.svg');
}

return $this->config->get('cp_icon');
}

public function hidden(): bool
{
return $this->config->get('hidden', false);
Expand Down Expand Up @@ -290,7 +281,6 @@ public function toArray(): array
'model' => $this->model(),
'name' => $this->name(),
'blueprint' => $this->blueprint(),
'cp_icon' => $this->cpIcon(),
'hidden' => $this->hidden(),
'route' => $this->route(),
'has_publish_states' => $this->hasPublishStates(),
Expand Down
1 change: 0 additions & 1 deletion src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ protected function registerNavigation(): self
->each(function (Resource $resource) use (&$nav) {
$nav->create($resource->name())
->section('Content')
->icon($resource->cpIcon())
->route('runway.index', ['resource' => $resource->handle()])
->can('view', $resource);
});
Expand Down

0 comments on commit 392d4da

Please sign in to comment.