Skip to content

Commit

Permalink
readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakariaTlilani committed Jan 11, 2024
1 parent 496dbf8 commit 2c3e0c6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
# text-template
text template for laravel nova
# Laravel Nova Text Template

Support laravel nova 3.

## Installation

``` php
composer require zakariatlilani/text-template
```

## Usage

``` php
use ZakariaTlilani\TextTemplate\TextTemplate;

TextTemplate::make('Name')
->category('category') // the category related to the text template
->endpoint('/api/loadData/{category}/product/{product}'), // the endpoint related to the template (a product in this scenario)

```
8 changes: 4 additions & 4 deletions src/TitleTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@

use Laravel\Nova\Fields\Field;

class Template extends Field
class TextTemplate extends Field
{
/**
* The field's component.
*
* @var string
*/
public $component = 'title-template';
public $component = 'text-template';

/**
* @param $category
* @return TitleTemplate
* @return TextTemplate
*/
public function category($category)
{
Expand All @@ -26,7 +26,7 @@ public function category($category)

/**
* @param $endpoint
* @return TitleTemplate
* @return TextTemplate
*/
public function endpoint($endpoint)
{
Expand Down

0 comments on commit 2c3e0c6

Please sign in to comment.