forked from tomhatzer/nova-slug-field
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48e7209
commit 73cacfa
Showing
19 changed files
with
13,071 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/.idea | ||
/vendor | ||
/node_modules | ||
package-lock.json | ||
composer.phar | ||
composer.lock | ||
phpunit.xml | ||
.phpunit.result.cache | ||
.DS_Store | ||
Thumbs.db |
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,36 @@ | ||
# Laravel Nova Slug Field | ||
|
||
Simple Laravel Nova Slug field. Generating a slugified version of a text | ||
input. See the result of the slug while typing. | ||
|
||
### Details Page | ||
|
||
![details page select](https://raw.githubusercontent.com/benjaminhirsch/benjaminhirsch.github.io/master/repository-assets/nova-slug-demo.gif) | ||
|
||
## Installation | ||
|
||
In order to use this package, you need a Laravel installation which uses [Nova](https://nova.laravel.com). | ||
|
||
**Composer** | ||
|
||
```bash | ||
composer require benjaminhirsch/nova-slug-field | ||
``` | ||
|
||
## Usage | ||
|
||
``` | ||
TextWithSlug::make('Name') | ||
->sortable() | ||
->slug('Slug') | ||
->rules('required', 'max:255'), | ||
Slug::make('Slug') | ||
->rules('required', 'max:255'), | ||
``` | ||
|
||
This first field definition is the field which you want to create the slug of. The second field | ||
definition represents the slugified version. With the ```->slug('name')``` method, you define | ||
the name of the field which holds the slug. It is possible to create multiple slugs on a single | ||
resource, just add more field definitions. Every ```TextWithSlug``` field needs a corresponding | ||
```Slug``` field. |
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,40 @@ | ||
{ | ||
"name": "benjaminhirsch/nova-slug-field", | ||
"description": "A Laravel Nova field to generate a slugs.", | ||
"keywords": [ | ||
"laravel", | ||
"nova" | ||
], | ||
"authors": [ | ||
{ | ||
"name": "Benjamin Hirsch", | ||
"email": "[email protected]", | ||
"role": "Developer", | ||
"homepage": "https://wwwbenjaminhirsch.net" | ||
} | ||
], | ||
"support": { | ||
"issues": "https://github.com/benjaminhirsch/nova-slug-field/issues" | ||
}, | ||
"license": "MIT", | ||
"require": { | ||
"php": ">=7.1.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Benjaminhirsch\\NovaSlugField\\": "src/" | ||
} | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"Benjaminhirsch\\NovaSlugField\\FieldServiceProvider" | ||
] | ||
} | ||
}, | ||
"config": { | ||
"sort-packages": true | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true | ||
} |
Empty file.
Oops, something went wrong.