Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review end to end the slug saving flow #2696

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class Page extends Model
'description',
];

public $slugAttributes = [
protected $slugFields = [
'title',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Article extends Model implements LocalizedUrlRoutable
'description',
];

public $slugAttributes = [
protected $slugFields = [
'title',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Article extends Model implements Sortable

// #endregion fillable

public $slugAttributes = [
private $slugFields = [
'title',
];

Expand Down
2 changes: 1 addition & 1 deletion examples/basic-page-builder/app/Models/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Page extends Model
'description',
];

public $slugAttributes = [
protected $slugFields = [
'title',
];
}
2 changes: 1 addition & 1 deletion examples/portfolio/app/Models/Partner.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Partner extends Model
'description',
];

public $slugAttributes = [
protected $slugFields = [
'title',
];

Expand Down
2 changes: 1 addition & 1 deletion examples/portfolio/app/Models/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Project extends Model
'description',
];

public $slugAttributes = [
protected $slugFields = [
'title',
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Post extends Model implements Sortable

public $translatedAttributes = ['title', 'description'];

public $slugAttributes = ['title'];
public $slugFields = ['title'];

public $mediasParams = [
'cover' => [
Expand Down
2 changes: 1 addition & 1 deletion examples/tests-modules/app/Models/Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Author extends Model implements Sortable
public $translatedAttributes = ['name', 'description', 'bio'];

// uncomment and modify this as needed if you use the HasSlug trait
public $slugAttributes = ['name'];
protected $slugFields = ['name'];

// add checkbox fields names here (published toggle is itself a checkbox)
public $checkboxes = ['published'];
Expand Down
2 changes: 1 addition & 1 deletion examples/tests-modules/app/Models/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Category extends Model
public $translatedAttributes = ['title'];

// uncomment and modify this as needed if you use the HasSlug trait
public $slugAttributes = ['title'];
protected $slugFields = ['title'];

// add checkbox fields names here (published toggle is itself a checkbox)
public $checkboxes = ['published'];
Expand Down
2 changes: 1 addition & 1 deletion examples/tests-singleton/app/Models/ContactPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ContactPage extends Model
'description',
];

public $slugAttributes = [
protected $slugFields = [
'title',
];

Expand Down
2 changes: 1 addition & 1 deletion examples/tests-subdomain-routing/app/Models/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Page extends Model implements Sortable
'description',
];

public $slugAttributes = [
public $slugFields = [
'title',
];

Expand Down
3 changes: 2 additions & 1 deletion src/Commands/stubs/model.stub
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ class {{modelClassName}} extends Model {{modelImplements}}
'description',
];
{{/hasTranslation}}{{hasSlug}}
public $slugAttributes = [
protected $slugFields = [
'title',
];
protected $slugDeps = [];
{{/hasSlug}}
}
Loading
Loading