Skip to content

Commit

Permalink
Remove ->text() and update field title
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristories committed Jan 15, 2022
1 parent 00ec4dd commit c2de851
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/Resources/QrcodeManager.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

namespace Kristories\QrcodeManager\Resources;

use Laravel\Nova\Resource;
use Illuminate\Http\Request;
use Kristories\Qrcode\Qrcode;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Resource;

class QrcodeManager extends Resource
{
Expand All @@ -28,6 +29,7 @@ class QrcodeManager extends Resource
* @var string
*/
public static $title = 'text';

/**
* The columns that should be searched.
*
Expand All @@ -36,6 +38,7 @@ class QrcodeManager extends Resource
public static $search = [
'text',
];

/**
* Get the displayable label of the resource.
*
Expand All @@ -45,6 +48,7 @@ public static function label()
{
return __('qrcode-manager::navigation.label');
}

/**
* Get the fields displayed by the resource.
*
Expand All @@ -54,27 +58,26 @@ public static function label()
public function fields(Request $request)
{
return [
Qrcode::make('QR Code')
->text($this->text)
Qrcode::make('QR Code', 'text')
->background($this->background)
->logo($this->logo)
->exceptOnForms(),

Text::make('Text')
Text::make('Text', 'text')
->sortable()
->rules([
'required',
]),

Text::make('Background')
Text::make('Background Image URL', 'background')
->sortable()
->rules([
'nullable',
'url',
])
->onlyOnForms(),

Text::make('Logo')
Text::make('Logo Image URL', 'logo')
->sortable()
->rules([
'nullable',
Expand Down

0 comments on commit c2de851

Please sign in to comment.