generated from spatie/package-skeleton-laravel
-
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.
Sets up folder model and removes README.
- Loading branch information
Showing
13 changed files
with
84 additions
and
95 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
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
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,21 @@ | ||
<?php | ||
|
||
namespace Creode\LaravelFolderTaxonomy\Database\Factories; | ||
|
||
use Creode\LaravelFolderTaxonomy\Models\Folder as FolderModel; | ||
use Creode\LaravelTaxonomy\Database\Factories\TermFactory; | ||
|
||
|
||
class Folder extends TermFactory | ||
{ | ||
protected $model = FolderModel::class; | ||
|
||
public function definition() | ||
{ | ||
return [ | ||
'name' => $this->faker->word, | ||
'slug' => $this->faker->slug, | ||
]; | ||
// return parent::definition(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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,34 @@ | ||
<?php | ||
|
||
namespace Creode\LaravelFolderTaxonomy\Models; | ||
|
||
use Creode\LaravelTaxonomy\Models\Term; | ||
use Creode\LaravelTaxonomy\Concerns\Parentable; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
|
||
class Folder extends Term | ||
{ | ||
use Parentable; | ||
|
||
/** | ||
* Machine name of the specific term to use. | ||
* | ||
* @var string | ||
*/ | ||
protected $machine_name = 'folders'; | ||
|
||
/** | ||
* Fillable Properties for the model. | ||
* | ||
* @var array | ||
*/ | ||
protected $fillable = [ | ||
'name', | ||
'slug', | ||
]; | ||
|
||
protected static function newFactory(): Factory | ||
{ | ||
return \Creode\LaravelFolderTaxonomy\Database\Factories\Folder::new(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
<?php | ||
|
||
it('can create a folder model', function () { | ||
$folder = \Creode\LaravelFolderTaxonomy\Models\Folder::create([ | ||
'name' => 'Folder', | ||
'slug' => 'folder', | ||
]); | ||
|
||
expect($folder->name)->toBe('Folder'); | ||
expect($folder->slug)->toBe('folder'); | ||
}); |
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