You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create factory LinkFactory.php in database/factories/Structural folder
faker all fields except id, based on other entities - example
you can also add validator with reasonable rules
create file LinkFactoryTest.php in tests/Database/Factories/Structural folder and write tests for instance and scope methods like other entities - example
run tests with ./vendor/bin/pest --group=factories
Fields:
id
: number (given by default)download
: string|nullhref
: stringsrc
: string|nullicon
: string|nullcategory
: stringhreflang
: string|nullmedia
: string|nullping
: string|nullreferrerpolicy
: string|nullrel
: string|nulltarget
: string|nulltype
: string|nullstart_date
: stringend_date
: stringFor frontend interfaces use types from attributes list on site: https://www.w3schools.com/tags/tag_a.asp
Keep fields order in all files and methods like migrations, models fields, instance methods etc.
First commit
.husky/prepare-commit-msg
with final message "🔗 Link: $ORIGINAL_MSG"Second commit
Migration
php artisan make:migration create_links_table
php artisan migrate:fresh
and check if the migrations ran successfulLinkMigrationsTest.php
intests/Database/Migrations/Structural
folder and write tests like other entities - example./vendor/bin/pest --group=migrations
Model
Link.php
inapp/Models/Structural
folderprotected $fillable
with all fields, except id because Laravel handles it automaticallygetId
etc. with full typings as other entities in the project - examplescopeGetById
etc.LinkTest.php
intests/Database/Models/Structural
folder and write tests for instance and scope methods like other entities - example./vendor/bin/pest --group=models
Factory
LinkFactory.php
indatabase/factories/Structural
folderLinkFactoryTest.php
intests/Database/Factories/Structural
folder and write tests for instance and scope methods like other entities - example./vendor/bin/pest --group=factories
Seeder
LinkSeeder.php
indatabase/seeders/Structural
folder and call factories - exampleLinkSeeder
inStructuralSeeder.php
php artisan migrate:fresh --seed
and check if LinkSeeder ran successfulThird commit
Contract
LinkContract.php
inapp/Contracts
Transformer
LinkTransformer.php
inapp/Transformers
Controller
LinkController.php
inapp/Http/Controllers/Structural
LinkControllerTest.php
intests/Feature/Controllers/Structural
folder and write tests for all methods like other entities - exampleService
LinkService.php
inapp/Services/Structural
Routes
routes/api.php
Tests
The text was updated successfully, but these errors were encountered: