Skip to content

Commit

Permalink
Make sure the user exists
Browse files Browse the repository at this point in the history
Signed-off-by: snipe <[email protected]>
  • Loading branch information
snipe committed Jul 11, 2024
1 parent abd7921 commit 759bb82
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/Models/ConsumableAssignment.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Watson\Validating\ValidatingTrait;

class ConsumableAssignment extends Model
{
use CompanyableTrait;
use ValidatingTrait;

protected $table = 'consumables_users';

public $rules = [
'assigned_to' => 'exists:users,id',
];

public function consumable()
{
return $this->belongsTo(\App\Models\Consumable::class);
Expand Down

0 comments on commit 759bb82

Please sign in to comment.