discordoauth | PHP implementation of a Discord OAuth2 login flow | REST library
kandi X-RAY | discordoauth Summary
kandi X-RAY | discordoauth Summary
I have made a PHP script to help automate Oauth login for Discord [Login With Discord]. It contains a base and needs to be coded more to actually implement it into your website [Sessions has not been included, just the files to retrieve the info from the API]
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of discordoauth
discordoauth Key Features
discordoauth Examples and Code Snippets
Community Discussions
Trending Discussions on discordoauth
QUESTION
I've been researching this for hours, can't seem to solve it. Here is the error
General error: 1215 Cannot add foreign key constraint (SQL: alter table 'users' add constraint 'users_discord_id_foreign' foreign key ('discord_id') references 'discord_o_auths' ('id'))
Here is my DiscordOAuths Migration:
...ANSWER
Answered 2020-Apr-19 at 16:57You're trying to assign a foreign key constraint to an integer
column, which is not the same as the unsigned
columns that Laravel uses for its id's.
In your DiscordOAuths
you have to replace $table->integer('id')->unique();
with $table->bigIncrements('id');
or the new method added in Laravel 7 $table->id();
which is an alias of the previous one.
Your discord_id
column in the users
migration also needs to be an unsigned column. You have to define it using either $table->unsignedBigInteger('discord_id');
or its alias that came with Laravel 7: $table->foreignId('discord_id');
So your migrations would look like this:
For DiscordOAuths
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install discordoauth
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page