Update the following dependencies in composer.json
jakyeru/larascord
to^5.0
Run the composer update
command
composer update
Publish and run the migrations
php artisan vendor:publish --provider="Jakyeru\Larascord\LarascordServiceProvider" --tag="migrations"
php artisan migrate
Publish the config file
php artisan larascord:publish --force
Add the InteractsWithDiscord
trait to your User
model
app/Models/User.php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;U
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use Jakyeru\Larascord\Traits\InteractsWithDiscord;
class User extends Authenticatable
{
use HasApiTokens, HasFactory, Notifiable, InteractsWithDiscord;
}
Remove the refresh_token
from the User
model's $fillable
and $hidden
arrays
Make sure the following values are in your $fillable
array and are casted to the correct type
Attribute | Cast |
---|---|
id | integer |
username | string |
global_name | string |
discriminator | string |
email | string |
avatar | string |
verified | boolean |
banner | string |
banner_color | string |
accent_color | string |
locale | string |
mfa_enabled | boolean |
premium_type | integer |
public_flags | integer |
roles | array |