-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from Muetze42/development
Development
- Loading branch information
Showing
31 changed files
with
674 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"/js/tool.js": "/js/tool.js?id=cf9c832eb5de9f26626d5243e87f8814", | ||
"/css/tool.css": "/css/tool.css?id=617a67680cd5dd5759b1963661ce40f1" | ||
"/js/tool.js": "/js/tool.js?id=48ae70bd83b0ea60302ae581b4f4c23a", | ||
"/css/tool.css": "/css/tool.css?id=4e2099e34bf226a8200bf60c4712a5d7" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
# Menu Card | ||
|
||
This package adds the possibility to display cards in the menu. | ||
|
||
## Usage | ||
|
||
You can create a new menu card by calling the `MenuCard::make` method. | ||
|
||
```php | ||
use NormanHuth\NovaMenu\MenuCard; | ||
|
||
MenuCard::make() | ||
``` | ||
|
||
### Set Content To A Card | ||
|
||
#### Set String Content | ||
|
||
You can set a string as content for a menu card by invoking the `content` method when defining the menu card: | ||
|
||
```php | ||
use NormanHuth\NovaMenu\MenuCard; | ||
|
||
MenuCard::make() | ||
->content('Norman Huth'), | ||
``` | ||
|
||
#### Set Blade As Content | ||
|
||
You can set a Blade template as content for a menu card by invoking the `view` method when defining the menu card: | ||
|
||
```php | ||
use NormanHuth\NovaMenu\MenuCard; | ||
|
||
MenuCard::make() | ||
->view('admin.news', ['name' => $request->user()->name])), | ||
``` | ||
|
||
### Authorization | ||
|
||
You can hide certain fields from a group of users by invoking the `canSee` method when defining the menu card: | ||
|
||
```php | ||
use NormanHuth\NovaMenu\MenuCard; | ||
|
||
MenuCard::make() | ||
->canSee(function (Request $request) { | ||
return str_ends_with($request->user()->email, '@huth.it'); | ||
}), | ||
``` | ||
|
||
### Customize And Theming | ||
|
||
### Use A Theme | ||
|
||
The static `make` method accept a theme argument. Valid themes are `info`, `success`, `warning` and `danger`. | ||
|
||
```php | ||
use NormanHuth\NovaMenu\MenuCard; | ||
|
||
MenuCard::make('info'), | ||
``` | ||
|
||
### Border Radios | ||
|
||
You can add a border radius by invoking the `rounded` method when defining the menu card: | ||
|
||
```php | ||
use NormanHuth\NovaMenu\MenuCard; | ||
|
||
MenuCard::make('info') | ||
->rounded(), | ||
MenuCard::make('info') | ||
->rounded('sm'), | ||
MenuCard::make('info') | ||
->rounded('md'), | ||
MenuCard::make('info') | ||
->rounded('lg'), | ||
``` | ||
|
||
### Add Classes | ||
|
||
You can add classes to the menu card class attribute by invoking the `addClasses` method when defining the menu card: | ||
|
||
```php | ||
use NormanHuth\NovaMenu\MenuCard; | ||
|
||
MenuCard::make() | ||
->addClasses(['text-center', 'text-white']), | ||
``` | ||
|
||
### Add Styles | ||
|
||
You can add styles to the menu card style attribute by invoking the `addStyles` method when defining the menu card: | ||
|
||
```php | ||
use NormanHuth\NovaMenu\MenuCard; | ||
|
||
MenuCard::make() | ||
->addStyles([ | ||
'color' => 'white', | ||
'text-align' => 'center', | ||
]), | ||
``` | ||
|
||
### Add `MenuItem` Spacing | ||
|
||
You can add the same left margin spacing like a `MenuItem` by invoking the `asItem` method when defining the menu card: | ||
|
||
```php | ||
use NormanHuth\NovaMenu\MenuCard; | ||
|
||
MenuCard::make() | ||
->asItem(), | ||
``` |
Oops, something went wrong.