generated from creasico/laravel-package
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor-classnames: chore: update model's contracts chore: apply changes c549f97 chore: apply changes 6a118c2 refactor!: get rid of unnecessary interface feat: add more model traits to helps extendability of address refactor!: rename address classnames
- Loading branch information
Showing
21 changed files
with
233 additions
and
112 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,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Creasi\Nusa\Contracts; | ||
|
||
/** | ||
* @property-read null|Address $address | ||
* | ||
* @mixin \Illuminate\Database\Eloquent\Model | ||
*/ | ||
interface HasAddress | ||
{ | ||
/** | ||
* @return \Illuminate\Database\Eloquent\Relations\MorphOne|\Address | ||
*/ | ||
public function address(); | ||
} |
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 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
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,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Creasi\Nusa\Models\Concerns; | ||
|
||
use Creasi\Nusa\Models\District; | ||
|
||
/** | ||
* @property-read null|\Creasi\Nusa\Contracts\District $district | ||
* | ||
* @mixin \Illuminate\Database\Eloquent\Model | ||
*/ | ||
trait BelongsToDistrict | ||
{ | ||
/** | ||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo|\Creasi\Nusa\Contracts\District | ||
*/ | ||
public function district() | ||
{ | ||
return $this->belongsTo(District::class); | ||
} | ||
} |
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,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Creasi\Nusa\Models\Concerns; | ||
|
||
use Creasi\Nusa\Models\Province; | ||
|
||
/** | ||
* @property-read null|\Creasi\Nusa\Contracts\Province $province | ||
* | ||
* @mixin \Illuminate\Database\Eloquent\Model | ||
*/ | ||
trait BelongsToProvince | ||
{ | ||
/** | ||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo|\Creasi\Nusa\Contracts\Province | ||
*/ | ||
public function province() | ||
{ | ||
return $this->belongsTo(Province::class); | ||
} | ||
} |
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,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Creasi\Nusa\Models\Concerns; | ||
|
||
use Creasi\Nusa\Models\Regency; | ||
|
||
/** | ||
* @property-read null|\Creasi\Nusa\Contracts\Regency $regency | ||
* | ||
* @mixin \Illuminate\Database\Eloquent\Model | ||
*/ | ||
trait BelongsToRegency | ||
{ | ||
/** | ||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo|\Creasi\Nusa\Contracts\Regency | ||
*/ | ||
public function regency() | ||
{ | ||
return $this->belongsTo(Regency::class); | ||
} | ||
} |
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,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Creasi\Nusa\Models\Concerns; | ||
|
||
use Creasi\Nusa\Models\Village; | ||
|
||
/** | ||
* @property-read null|\Creasi\Nusa\Contracts\Village $village | ||
* | ||
* @mixin \Illuminate\Database\Eloquent\Model | ||
*/ | ||
trait BelongsToVillage | ||
{ | ||
/** | ||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo|\Creasi\Nusa\Contracts\Village | ||
*/ | ||
public function village() | ||
{ | ||
return $this->belongsTo(Village::class); | ||
} | ||
} |
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
Oops, something went wrong.