Examples of code I've written in PHP, Javascript, SCSS, etc.
25개 이상의 토픽을 선택하실 수 없습니다.
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?php
-
- namespace App\Models;
-
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- use App\Models\User;
- use App\Models\Service;
-
- class Order extends Model
- {
- use HasFactory;
-
- protected $fillable = [
- 'quantity', 'url'
- ];
-
- public function service() {
- return $this->belongsTo(Service::class);
- }
-
- public function user() {
- return $this->belongsTo(User::class);
- }
-
- public function getServiceNameAttribute() {
- return $this->service()->name();
- }
-
- }
|