Start
This commit is contained in:
40
app/UserForm.php
Normal file
40
app/UserForm.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class UserForm extends Model
|
||||
{
|
||||
/**
|
||||
* The attributes that aren't mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'permissions' => 'array',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the user to which form is assgined
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(\App\User::class, 'assigned_to');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the form which is assigned
|
||||
*/
|
||||
public function form()
|
||||
{
|
||||
return $this->belongsTo(\App\Form::class, 'form_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user