Do a little troubleshooting using a combination of dd and the web developer tools. This usually helps me find problems.
Jul 5, 2023
14
Level 1
Equivalent Relations working in development but not in production
Hello everyone,
I'm encountering an issue with the $bot->tags function in my code. In the development environment, it works perfectly fine, but when I deploy it to production, it returns an empty result. I have verified that the data should be filled, so I'm certain that the issue lies elsewhere.
Here is my model:
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Bot extends Model
{
use HasFactory;
protected $guarded = [];
public function tags()
{
return $this->hasMany(BotTag::class, 'bot_id', 'id');
}
public function users()
{
return $this->hasMany(BotUser::class, 'bot_id', 'id');
}
public function lister()
{
return $this->hasOne(User::class, 'id', 'author');
}
}
So far I'v tried to change my database Engine to innoDB.
Thanks a lot!
Please or to participate in this conversation.