diff --git a/.env.example b/.env.example index f5ed15a93..a0731890f 100644 --- a/.env.example +++ b/.env.example @@ -25,6 +25,7 @@ SESSION_DRIVER=redis SESSION_LIFETIME=120 QUEUE_DRIVER=redis +REDIS_SCHEME=tcp REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379 diff --git a/.env.testing b/.env.testing index 2794527a9..16f147f88 100644 --- a/.env.testing +++ b/.env.testing @@ -25,6 +25,7 @@ SESSION_DRIVER=redis SESSION_LIFETIME=120 QUEUE_DRIVER=redis +REDIS_SCHEME=tcp REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379 diff --git a/app/Place.php b/app/Place.php index c7c7d68be..a63c507c5 100644 --- a/app/Place.php +++ b/app/Place.php @@ -7,15 +7,8 @@ use Pixelfed\Snowflake\HasSnowflakePrimary; class Place extends Model { - use HasSnowflakePrimary; + protected $visible = ['id', 'name', 'country', 'slug']; - /** - * Indicates if the IDs are auto-incrementing. - * - * @var bool - */ - public $incrementing = false; - public function url() { return url('/discover/places/' . $this->id . '/' . $this->slug); @@ -30,4 +23,9 @@ class Place extends Model { return $this->posts()->count(); } + + public function statuses() + { + return $this->hasMany(Status::class, 'id', 'place_id'); + } } diff --git a/config/cache.php b/config/cache.php index 93190d5bb..f9d09b03f 100644 --- a/config/cache.php +++ b/config/cache.php @@ -73,6 +73,8 @@ return [ 'client' => 'predis', 'default' => [ + 'scheme' => env('REDIS_SCHEME', 'tcp'), + 'path' => env('REDIS_PATH'), 'host' => env('REDIS_HOST', 'localhost'), 'password' => env('REDIS_PASSWORD', null), 'port' => env('REDIS_PORT', 6379), diff --git a/config/database.php b/config/database.php index fb8136b3e..8d227e0cc 100644 --- a/config/database.php +++ b/config/database.php @@ -109,6 +109,8 @@ return [ 'client' => 'predis', 'default' => [ + 'scheme' => env('REDIS_SCHEME', 'tcp'), + 'path' => env('REDIS_PATH'), 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), 'port' => env('REDIS_PORT', 6379),