Created
August 30, 2020 17:15
-
-
Save edgrosvenor/f4f8f71347b7dacdf92e1cca0c5bd29e to your computer and use it in GitHub Desktop.
A POINT column, left to its own devices, results in a messy attempt at a string when sent through ->toArray()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Models; | |
use Illuminate\Database\Eloquent\Model; | |
class College extends Model | |
{ | |
protected $connection = 'v1'; | |
protected $table = 'colleges_colleges'; | |
// protected $hidden = ['location']; <-- This ultimately solved it | |
} | |
/** Here is the array before hiding the location column: | |
[ 'id' => 2197, | |
'name' => 'Agnes Scott College', | |
'short_name' => 'Agnes Scott', | |
'abbreviation' => 'Agnes Scott', | |
'unitid' => '138600', | |
'city' => 'Decatur', 'state' => 'GA', | |
'location' => "\0\0\0\0".''."\0\0\0".'p��R�U��)s��@@', | |
'governing_body' => 'NCAA', 'division' => '3', | |
'conference' => 'Great South', | |
'mascot' => null, | |
'created_at' => '2018-01-22T21:21:10.000000Z', | |
'updated_at' => '2019-03-27T19:01:11.000000Z', | |
'image' => 'https://d3on3ztz3vi4v9.cloudfront.net/images/colleges/138600/300/1551473956/138600.png', | |
'us_rank' => 73, | |
'us_rank_type' => 'National Liberal Arts', ] | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment