1
0
mirror of https://github.com/cp6/my-idlers.git synced 2024-11-16 15:33:44 +01:00
my-idlers/app/Models/Labels.php
cp6 a314ac99ef Initial v2 commit
Initial v2 commit

Laravel project
2022-02-18 15:48:32 +11:00

28 lines
699 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class Labels extends Model
{
use HasFactory;
public $incrementing = false;
protected $fillable = ['id', 'label', 'server_id', 'server_id_2', 'domain_id', 'domain_id_2', 'shared_id', 'shared_id_2'];
public static function deleteLabelsAssignedTo($service_id)
{
DB::table('labels_assigned')->where('service_id', '=', $service_id)->delete();
}
public static function deleteLabelAssignedAs($label_id)
{
DB::table('labels_assigned')->where('label_id', '=', $label_id)->delete();
}
}