Download the PHP package digram/bukua-auth without Composer
On this page you can find all versions of the php package digram/bukua-auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download digram/bukua-auth
More information about digram/bukua-auth
Files in digram/bukua-auth
Package bukua-auth
Short Description Login with Bukua OAuth for your Laravel application
License Apache-2.0
Homepage https://www.bukuaplatform.com
Informations about the package bukua-auth
Login with Bukua OAuth for Laravel
This package simplifies OAuth authentication using Bukua in Laravel applications.
Prerequisites
Bukua Developer Account:
- Create a User Access Client in the Bukua Developer Dashboard.
- Obtain your:
client_id
client_secret
Configuration
Add these variables to your .env
file:
Key Notes:
✅ BUKUA_USER_MODEL
: Ensure this matches your application’s User
model location.
✅ Callback URL: Must be registered when creating a user access client in the developer dashboard.
User model configuration
To ensure your User
model can handle the necessary data, you need to update the fillable
property to include the following fields:
Users table configuration
Update your users
table migration to ensure it includes the new fields. Ensure all fields in your users table are nullable to prevent errors when adding a new user.
Execute the migration to apply the changes to your database:
Installation
-
In your terminal, run
- Clear your configuration cache by running
Adding the Login Button
To implement the "Login with Bukua" button in your Blade template:
Events (Optional Customization)
Listen for the BukuaUserLoggedInEvent
event to extend functionality:
Example Use Cases:
- Make further api calls, e.g, to fetch user subjects.
- Log when a user signs in.
User Information Endpoints
Endpoints for fetching information about the currently authenticated user.
Endpoints
1. Basic Profile
- Endpoint:
GET /api/v1/me
- Description: Retrieves the basic profile information of the logged-in user such as name and school.
2. User Roles
- Endpoint:
GET /api/v1/me/roles
- Description: Returns the roles associated with the current user at their school (e.g., teacher, principal, or head of department).
3. User Subjects
- Endpoint:
GET /api/v1/me/subjects
- Description: Fetches the subjects associated with the authenticated user.