From 4faf3642b187aecdd154c81b27db30170d9aa6ba Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 25 Nov 2024 16:35:43 +0100 Subject: [PATCH] Install sanctum for api requests. --- bootstrap/app.php | 1 + composer.json | 1 + composer.lock | 68 +++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 68 insertions(+), 2 deletions(-) diff --git a/bootstrap/app.php b/bootstrap/app.php index 7b162da..d654276 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -7,6 +7,7 @@ use Illuminate\Foundation\Configuration\Middleware; return Application::configure(basePath: dirname(__DIR__)) ->withRouting( web: __DIR__.'/../routes/web.php', + api: __DIR__.'/../routes/api.php', commands: __DIR__.'/../routes/console.php', health: '/up', ) diff --git a/composer.json b/composer.json index dfd9d13..9dc6778 100644 --- a/composer.json +++ b/composer.json @@ -8,6 +8,7 @@ "require": { "php": "^8.4", "laravel/framework": "^11.31", + "laravel/sanctum": "^4.0", "laravel/tinker": "^2.9" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 0b39687..401574e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "20eb90a079f6ea91bbab3e4d6f509532", + "content-hash": "a8db73cb41e30a4fa98c08904c414994", "packages": [ { "name": "brick/math", @@ -1322,6 +1322,70 @@ }, "time": "2024-11-12T14:59:47+00:00" }, + { + "name": "laravel/sanctum", + "version": "v4.0.4", + "source": { + "type": "git", + "url": "https://github.com/laravel/sanctum.git", + "reference": "819782c75aaf2b08da1765503893bd2b8023d3b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/sanctum/zipball/819782c75aaf2b08da1765503893bd2b8023d3b3", + "reference": "819782c75aaf2b08da1765503893bd2b8023d3b3", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/console": "^11.0", + "illuminate/contracts": "^11.0", + "illuminate/database": "^11.0", + "illuminate/support": "^11.0", + "php": "^8.2", + "symfony/console": "^7.0" + }, + "require-dev": { + "mockery/mockery": "^1.6", + "orchestra/testbench": "^9.0", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Sanctum\\SanctumServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Sanctum\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.", + "keywords": [ + "auth", + "laravel", + "sanctum" + ], + "support": { + "issues": "https://github.com/laravel/sanctum/issues", + "source": "https://github.com/laravel/sanctum" + }, + "time": "2024-11-15T14:47:23+00:00" + }, { "name": "laravel/serializable-closure", "version": "v2.0.0", @@ -7908,7 +7972,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^8.2" + "php": "^8.4" }, "platform-dev": {}, "plugin-api-version": "2.6.0"