Used Eloquent
This commit is contained in:
parent
b512caecc7
commit
b20e405906
|
@ -5,7 +5,6 @@ namespace App\Models;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
|
|
||||||
class Labels extends Model
|
class Labels extends Model
|
||||||
{
|
{
|
||||||
|
@ -33,7 +32,10 @@ class Labels extends Model
|
||||||
{
|
{
|
||||||
for ($i = 1; $i <= 4; $i++) {
|
for ($i = 1; $i <= 4; $i++) {
|
||||||
if (!is_null($labels_array[($i - 1)])) {
|
if (!is_null($labels_array[($i - 1)])) {
|
||||||
DB::table('labels_assigned')->insert(['label_id' => $labels_array[($i - 1)], 'service_id' => $service_id]);
|
LabelsAssigned::create([
|
||||||
|
'label_id' => $labels_array[($i - 1)],
|
||||||
|
'service_id' => $service_id
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user