MOON
Server: Apache
System: Linux server.royaltuning.hu 4.18.0-425.13.1.el8_7.x86_64 #1 SMP Tue Feb 21 04:20:52 EST 2023 x86_64
User: royaltuning (1001)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/royaltuning/www/public/backoffice.royaltuning.hu/app/Models/WooOrder.php
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;

class WooOrder extends Model
{
    use HasFactory;

    protected $fillable = [
        'order_id', 'order_number', 'source', 'customer_id', 'customer_name', 'customer_email', 'customer_phone',
        'billing_first_name', 'billing_last_name', 'billing_company', 'billing_address_1',
        'billing_address_2', 'billing_city', 'billing_state', 'billing_postcode', 'billing_country',
        'shipping_first_name', 'shipping_last_name', 'shipping_company', 'shipping_address_1',
        'shipping_address_2', 'shipping_city', 'shipping_state', 'shipping_postcode', 'shipping_country',
        'total', 'currency', 'payment_method', 'status', 'items', 'order_date'
    ];

    protected $casts = [
        'items' => 'array',
    ];

    public function scopeSearch(Builder $query, $term)
    {
        return $query->where('id', 'LIKE', "%{$term}%")
            ->orWhere('customer_name', 'LIKE', "%{$term}%")
            ->orWhere('status', 'LIKE', "%{$term}%")
            ->orWhere('customer_email', 'LIKE', "%{$term}%");
    }
}