Using a Model instead of \DB::table

Posted 1 month ago by screwtape_mk

Hi

I have a variable

$countries=\DB::table('AREAS');

works fine but the minute i use a model it ceases to work:

$countries=ServiceAreas::all();

The Model is ServiceAreas.php:

<?php namespace App\Models;


use Illuminate\Database\Eloquent\Model;



class ServiceAreas extends Model 
{
    
    protected $table = 'AREAS';
    

    }

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