<?php

namespace App\Models;

use App\Models\traits\SetConnection;
use Illuminate\Support\Facades\Auth;
use Illuminate\Database\Eloquent\Model;

class PortalSuumoTrafficMap extends Model
{
    use SetConnection;

    protected $fillable = [
        'article_id', 'memo', 'file_path', 'company_id'
    ];

    const CREATED_AT = null;
    const UPDATED_AT = null;

    //

    public static function getImgByArticleId($id)
    {
        $res = PortalSuumoTrafficMap::where('article_id', '=', $id)->where("company_id", auth()->user()->company_id)
            ->get();
        return $res;
    }
}
