DeveloperBreeze

Api Authentication Development Tutorials, Guides & Insights

Unlock 2+ expert-curated api authentication tutorials, real-world code snippets, and modern dev strategies. From fundamentals to advanced topics, boost your api authentication skills on DeveloperBreeze.

Creating Personal Access Tokens for a Custom Model in Laravel

Tutorial October 24, 2024

In this tutorial, we walked through the process of generating and managing personal access tokens for a custom model in Laravel using Sanctum. This includes setting up your model, creating tokens, using them for API authentication, and displaying them in a Blade view.

By leveraging Laravel Sanctum, you can easily authenticate API requests in a secure and scalable way, while providing flexibility for defining token abilities and managing tokens across different models.

بناء API متقدم باستخدام Laravel Passport للتوثيق

Tutorial September 27, 2024
php

use App\Http\Controllers\AuthController;

Route::post('register', [AuthController::class, 'register']);
Route::post('login', [AuthController::class, 'login']);

// مسار للحصول على بيانات المستخدم المسجل
Route::middleware('auth:api')->get('/user', [AuthController::class, 'user']);

الآن يمكنك اختبار واجهة الـ API باستخدام Postman.