geetpurwar
1 year ago

Eloquent returning empty collection

Posted 1 year ago by geetpurwar

Hi,

My Subscriber Model is returning empty collection.

Here's the Model. And Model class is custom here. Any suggestions whats wrong in here.

<?php

namespace App;
use Illuminate\Database\Eloquent\SoftDeletes;

class Subscriber extends Model
{
    /* Soft-Deletes */
    use SoftDeletes;
    protected $dates = ['deleted_at'];

    /* Relationship */
    public function website()
    {
        return $this->belongsTo(Website::class);
    }

    public function create(Request $request)
    {
        return $this->request;
    }
}

Model Class:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model as Eloquent;
use Spatie\Geocoder\Geocoder;

class Model extends Eloquent
{
    protected $fillable = [
        'uuid',
        'website_id',
        'endpoint',
        'publicKey',
        'authToken',
        'contentEncoding',
        'browser_name',
        'browser_version',
        'browser_timezone',
        'browser_timezone_offset',
        'browser_language',
        'browser_local_time',
        'useragent',
        'platform_name',
        'platform_version',
        'platform_vendor',
        'platform_model',
        'platform_type',
        'is_mobile',
        'is_touch',
        'is_secure',
        'HTTP_REFERER',
        'HTTP_ORIGIN',
        'HTTP_HOST',
        'referral_url',
        'referral_website',
        'IP',
        'ip_is_decoded',
        'ip_country_iso',
        'ip_country',
        'ip_state_short',
        'ip_state',
        'ip_city',
        'ip_postal_code',
        'ip_lat',
        'ip_lon',
        'ip_lat_lon',
        'ip_timezone',
        'ip_currency',
        'ip_as',
        'ip_isp',
        'ip_org',
        'ip_is_mobile',
        'ip_is_proxy',
        'is_located',
        'location_lat',
        'location_lon',
        'location_lat_lon',
        'location_is_decoded',
        'location_country',
        'location_state',
        'location_district',
        'location_city',
        'location_postal_code',
        'location_formatted_address',
        'is_ecommerce',
        'ecommerce_count',
        'ecommerce_amount',
        'ecommerce_checkout',
        'ecommerce_currency',
        'ecommerce_timestamp'
    ];
}

Please sign in or create an account to participate in this conversation.