dynamic elements and groups
This commit is contained in:
1 parent
80db5b6c6d
commit
0c3142f2fd
42 files changed
+798
-17
No files matched your search
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AddByMethod extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -11,6 +11,7 @@ class CompetitionGroupProvider extends Model
|
||||
'competition_group_id',
|
||||
'provider_id',
|
||||
'provider_group_id',
|
||||
'add_by_method_id',
|
||||
'name',
|
||||
];
|
||||
|
||||
@@ -23,4 +24,14 @@ class CompetitionGroupProvider extends Model
|
||||
{
|
||||
return $this->belongsTo(Provider::class);
|
||||
}
|
||||
|
||||
public function sport()
|
||||
{
|
||||
return $this->belongsTo(Sport::class);
|
||||
}
|
||||
|
||||
public function add_by_method()
|
||||
{
|
||||
return $this->belongsTo(AddByMethod::class);
|
||||
}
|
||||
}
|
||||
@@ -17,4 +17,14 @@ class Element extends Model
|
||||
{
|
||||
return $this->belongsTo(Sport::class);
|
||||
}
|
||||
|
||||
public function country()
|
||||
{
|
||||
return $this->belongsTo(Country::class);
|
||||
}
|
||||
|
||||
public function element_group()
|
||||
{
|
||||
return $this->belongsTo(ElementGroup::class, 'id', 'element_id');
|
||||
}
|
||||
}
|
||||
@@ -11,4 +11,19 @@ class ElementGroup extends Model
|
||||
'group_id',
|
||||
'competition_group_id',
|
||||
];
|
||||
|
||||
public function element()
|
||||
{
|
||||
return $this->belongsTo(Element::class);
|
||||
}
|
||||
|
||||
public function group()
|
||||
{
|
||||
return $this->belongsTo(Group::class);
|
||||
}
|
||||
|
||||
public function competition_group()
|
||||
{
|
||||
return $this->belongsTo(CompetitionGroup::class);
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ class ElementProvider extends Model
|
||||
'element_id',
|
||||
'provider_id',
|
||||
'provider_element_id',
|
||||
'add_by_method_id',
|
||||
'name',
|
||||
];
|
||||
|
||||
@@ -20,6 +21,11 @@ class ElementProvider extends Model
|
||||
return $this->belongsTo(Sport::class);
|
||||
}
|
||||
|
||||
public function element_group()
|
||||
{
|
||||
return $this->belongsTo(ElementGroup::class, 'element_id', 'element_id');
|
||||
}
|
||||
|
||||
public function element()
|
||||
{
|
||||
return $this->belongsTo(Element::class);
|
||||
@@ -29,4 +35,9 @@ class ElementProvider extends Model
|
||||
{
|
||||
return $this->belongsTo(Provider::class);
|
||||
}
|
||||
|
||||
public function add_by_method()
|
||||
{
|
||||
return $this->belongsTo(AddByMethod::class);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user