Skip to content

Commit

Permalink
fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
yassir3wad committed Sep 30, 2019
1 parent 552ca06 commit eb5be46
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 25 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"license": "MIT",
"require": {
"php": ">=7.1.0",
"spatie/laravel-sluggable": "^2.1",
"benjaminhirsch/nova-slug-field": "^1.2",
"laravel/nova": "^2.0"
},
Expand Down
23 changes: 1 addition & 22 deletions src/Models/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
namespace MohRajab\NovaForms\Models;

use Illuminate\Database\Eloquent\Model;
use Spatie\Sluggable\HasSlug;
use Spatie\Sluggable\SlugOptions;

class Form extends Model
{
use HasSlug;
protected $fillable = ['name', 'emails', 'inputs'];
protected $fillable = ['name', 'emails', 'inputs', 'slug'];

protected $casts = [
'inputs' => 'array'
Expand All @@ -19,22 +16,4 @@ public function entries()
{
return $this->hasMany(FormEntry::class);
}

public function getSlugOptions(): SlugOptions
{
return SlugOptions::create()
->generateSlugsFrom('name')
->saveSlugsTo('slug')
->doNotGenerateSlugsOnUpdate();
}

/**
* Get the route key for the model.
*
* @return string
*/
public function getRouteKeyName()
{
return 'slug';
}
}
4 changes: 2 additions & 2 deletions src/Resources/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Form extends Resource
*/
public static $title = 'name';

public static $displayInNavigation = false;
public static $displayInNavigation = false;

/**
* The columns that should be searched.
Expand All @@ -54,7 +54,7 @@ public function fields(Request $request)
->slug('slug'),

Slug::make('Slug')
->disableAutoUpdateWhenUpdating(),
->disableAutoUpdateWhenUpdating(),

Text::make('Emails')
->help('add (,) as separator for multiple emails')
Expand Down

0 comments on commit eb5be46

Please sign in to comment.