Skip to content

bleuren/laravel-social-auth

Repository files navigation

Laravel 12 Social Authentication and Team Management System

A Laravel 12 based system that integrates multiple social platform logins and team management features. The system supports binding multiple social accounts to a single user account and provides comprehensive account management functionality.

Features

Social Platform Integration

  • Support for multiple social platform logins:
    • GitHub
    • Google
    • LINE
  • Single account can bind multiple social platforms
  • Flexible social account management:
    • Bind new social accounts
    • Unbind existing social accounts
    • Login with any bound social account

Team Management

  • Automatic personal team creation
  • Team member management
  • Team invitation system

User Management

  • Profile management
  • Password updates
  • Two-factor authentication
  • Social account binding management
  • Multi-browser session management
  • Account deletion

System Requirements

  • PHP >= 8.2
  • Laravel 12.x
  • Composer
  • Node.js & NPM
  • MySQL/PostgreSQL

Installation

  1. Clone the project
git clone https://github.com/your-repository/laravel-social-auth.git
cd laravel-social-auth
  1. Install dependencies
composer install
npm install
  1. Environment setup
cp .env.example .env
php artisan key:generate
  1. Database setup
php artisan migrate
  1. Social platform configuration Configure the following parameters in your .env file:
# GitHub
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret
GITHUB_REDIRECT_URI=your-github-callback-url

# Google
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
GOOGLE_REDIRECT_URI=your-google-callback-url

# LINE
LINE_CLIENT_ID=your-line-client-id
LINE_CLIENT_SECRET=your-line-client-secret
LINE_REDIRECT_URI=your-line-callback-url
  1. Start development server
php artisan serve
npm run dev

Project Structure

Core Services

  • app/Contracts/Services/SocialiteService.php: Social login service interface
  • app/Services/SocialiteManager.php: Social login implementation
  • app/Models/SocialAccount.php: Social account model

Controllers

  • app/Http/Controllers/Auth/SocialiteController.php: Handles social login flow
  • app/Livewire/Profile/SocialAccountsForm.php: Social account management interface

Views

  • resources/views/auth/login.blade.php: Login page
  • resources/views/profile/show.blade.php: Profile page
  • resources/views/livewire/profile/social-accounts-form.blade.php: Social account management form

Localization

The system supports multiple languages, currently including:

  • English (en)
  • Traditional Chinese (zh_TW)

Language files are located in the lang directory.

Development Commands

# Start development environment (includes server, queue listener, log monitoring, frontend compilation)
composer run dev

# Code style check
./vendor/bin/pint

# Run tests
php artisan test

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages