22 lines
612 B
PHP
22 lines
612 B
PHP
<?php
|
|
|
|
//The Model to a certain Controller, should contain a class with Controller name to which it belongs.
|
|
// Allows needed strings to passed onto the database. if there is none. class should appear empty.
|
|
|
|
//Reference to where the file belongs.
|
|
namespace App;
|
|
|
|
//allows the use of Model library
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Resource extends Model
|
|
{
|
|
public function resourceExtension() {
|
|
return $this->belongsTo("App\ResourceExtension");
|
|
}
|
|
|
|
public function resourceCategory() {
|
|
return $this->hasOneThrough("App\ResourceCategory", "App\ResourceExtension");
|
|
}
|
|
}
|