From 9623095ef61a7f131f34f358d3ee0bb6825797b8 Mon Sep 17 00:00:00 2001 From: Curtis Delicata Date: Thu, 13 Jun 2024 03:27:43 +0000 Subject: [PATCH] Remove migrations --- app/Models/User.php | 51 +- composer.json | 5 +- composer.lock | 961 ++++++++++++++++++++++++++++- config/app.php | 1 + database/factories/UserFactory.php | 58 +- resources/views/welcome.blade.php | 2 +- routes/web.php | 1 + 7 files changed, 1055 insertions(+), 24 deletions(-) diff --git a/app/Models/User.php b/app/Models/User.php index 4d7f70f..ef4c882 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -2,15 +2,27 @@ namespace App\Models; -// use Illuminate\Contracts\Auth\MustVerifyEmail; +use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; +use JoelButcher\Socialstream\HasConnectedAccounts; +use JoelButcher\Socialstream\SetsProfilePhotoFromUrl; +use Laravel\Fortify\TwoFactorAuthenticatable; +use Laravel\Jetstream\HasProfilePhoto; use Laravel\Sanctum\HasApiTokens; class User extends Authenticatable { - use HasApiTokens, HasFactory, Notifiable; + use HasApiTokens; + use HasConnectedAccounts; + use HasFactory; + use HasProfilePhoto { + HasProfilePhoto::profilePhotoUrl as getPhotoUrl; + } + use Notifiable; + use SetsProfilePhotoFromUrl; + use TwoFactorAuthenticatable; /** * The attributes that are mass assignable. @@ -24,22 +36,45 @@ class User extends Authenticatable ]; /** - * The attributes that should be hidden for serialization. + * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = [ 'password', 'remember_token', + 'two_factor_recovery_codes', + 'two_factor_secret', ]; /** - * The attributes that should be cast. + * The accessors to append to the model's array form. * - * @var array + * @var array */ - protected $casts = [ - 'email_verified_at' => 'datetime', - 'password' => 'hashed', + protected $appends = [ + 'profile_photo_url', ]; + + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + 'email_verified_at' => 'datetime', + ]; + } + + /** + * Get the URL to the user's profile photo. + */ + public function profilePhotoUrl(): Attribute + { + return filter_var($this->profile_photo_path, FILTER_VALIDATE_URL) + ? Attribute::get(fn () => $this->profile_photo_path) + : $this->getPhotoUrl(); + } } diff --git a/composer.json b/composer.json index c7e04e2..e01ef1f 100644 --- a/composer.json +++ b/composer.json @@ -11,11 +11,14 @@ "php": "^8.3", "filament/filament": "^3.2", "guzzlehttp/guzzle": "^7.8", + "joelbutcher/socialstream": "^6.0", "laravel/framework": "^11.0", + "laravel/jetstream": "^5.1", "laravel/octane": "^2.3", "laravel/sanctum": "^4.0", "laravel/tinker": "^2.9", - "livewire/livewire": "^3.5" + "livewire/livewire": "^3.5", + "stephenjude/filament-jetstream": "^0.0.11" }, "require-dev": { "fakerphp/faker": "^1.23", diff --git a/composer.lock b/composer.lock index 4dd1820..43156fe 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": "2e0031e3f870b73b4e3a17e73eecb231", + "content-hash": "987f4c9a7c167e8b9b8ee0d13985cee8", "packages": [ { "name": "anourvalar/eloquent-serialize", @@ -72,6 +72,60 @@ }, "time": "2024-03-22T12:56:46+00:00" }, + { + "name": "bacon/bacon-qr-code", + "version": "v3.0.0", + "source": { + "type": "git", + "url": "https://github.com/Bacon/BaconQrCode.git", + "reference": "510de6eca6248d77d31b339d62437cc995e2fb41" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/510de6eca6248d77d31b339d62437cc995e2fb41", + "reference": "510de6eca6248d77d31b339d62437cc995e2fb41", + "shasum": "" + }, + "require": { + "dasprid/enum": "^1.0.3", + "ext-iconv": "*", + "php": "^8.1" + }, + "require-dev": { + "phly/keep-a-changelog": "^2.12", + "phpunit/phpunit": "^10.5.11 || 11.0.4", + "spatie/phpunit-snapshot-assertions": "^5.1.5", + "squizlabs/php_codesniffer": "^3.9" + }, + "suggest": { + "ext-imagick": "to generate QR code images" + }, + "type": "library", + "autoload": { + "psr-4": { + "BaconQrCode\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Ben Scholzen 'DASPRiD'", + "email": "mail@dasprids.de", + "homepage": "https://dasprids.de/", + "role": "Developer" + } + ], + "description": "BaconQrCode is a QR code generator for PHP.", + "homepage": "https://github.com/Bacon/BaconQrCode", + "support": { + "issues": "https://github.com/Bacon/BaconQrCode/issues", + "source": "https://github.com/Bacon/BaconQrCode/tree/v3.0.0" + }, + "time": "2024-04-18T11:16:25+00:00" + }, { "name": "blade-ui-kit/blade-heroicons", "version": "2.3.0", @@ -456,6 +510,56 @@ ], "time": "2024-05-06T09:10:03+00:00" }, + { + "name": "dasprid/enum", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/DASPRiD/Enum.git", + "reference": "6faf451159fb8ba4126b925ed2d78acfce0dc016" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/DASPRiD/Enum/zipball/6faf451159fb8ba4126b925ed2d78acfce0dc016", + "reference": "6faf451159fb8ba4126b925ed2d78acfce0dc016", + "shasum": "" + }, + "require": { + "php": ">=7.1 <9.0" + }, + "require-dev": { + "phpunit/phpunit": "^7 | ^8 | ^9", + "squizlabs/php_codesniffer": "*" + }, + "type": "library", + "autoload": { + "psr-4": { + "DASPRiD\\Enum\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Ben Scholzen 'DASPRiD'", + "email": "mail@dasprids.de", + "homepage": "https://dasprids.de/", + "role": "Developer" + } + ], + "description": "PHP 7.1 enum implementation", + "keywords": [ + "enum", + "map" + ], + "support": { + "issues": "https://github.com/DASPRiD/Enum/issues", + "source": "https://github.com/DASPRiD/Enum/tree/1.0.5" + }, + "time": "2023-08-25T16:18:39+00:00" + }, { "name": "dflydev/dot-access-data", "version": "v3.0.2", @@ -1603,6 +1707,69 @@ }, "time": "2024-06-05T09:38:52+00:00" }, + { + "name": "firebase/php-jwt", + "version": "v6.10.1", + "source": { + "type": "git", + "url": "https://github.com/firebase/php-jwt.git", + "reference": "500501c2ce893c824c801da135d02661199f60c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/500501c2ce893c824c801da135d02661199f60c5", + "reference": "500501c2ce893c824c801da135d02661199f60c5", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^7.4", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", + "psr/cache": "^2.0||^3.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0" + }, + "suggest": { + "ext-sodium": "Support EdDSA (Ed25519) signatures", + "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" + }, + "type": "library", + "autoload": { + "psr-4": { + "Firebase\\JWT\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Neuman Vong", + "email": "neuman+pear@twilio.com", + "role": "Developer" + }, + { + "name": "Anant Narayanan", + "email": "anant@php.net", + "role": "Developer" + } + ], + "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", + "homepage": "https://github.com/firebase/php-jwt", + "keywords": [ + "jwt", + "php" + ], + "support": { + "issues": "https://github.com/firebase/php-jwt/issues", + "source": "https://github.com/firebase/php-jwt/tree/v6.10.1" + }, + "time": "2024-05-18T18:05:11+00:00" + }, { "name": "fruitcake/php-cors", "version": "v1.3.0", @@ -2147,6 +2314,87 @@ ], "time": "2023-12-03T19:50:20+00:00" }, + { + "name": "joelbutcher/socialstream", + "version": "v6.0.3", + "source": { + "type": "git", + "url": "https://github.com/joelbutcher/socialstream.git", + "reference": "ab33ab40b68603c2ee877c18d34760e314e224b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joelbutcher/socialstream/zipball/ab33ab40b68603c2ee877c18d34760e314e224b3", + "reference": "ab33ab40b68603c2ee877c18d34760e314e224b3", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^11.0", + "laravel/prompts": "^0.1.10", + "laravel/socialite": "^5.12", + "php": "^8.2" + }, + "require-dev": { + "laravel/breeze": "^2.0", + "laravel/jetstream": "^5.0", + "laravel/sanctum": "^4.0", + "livewire/livewire": "^3.3.5", + "mockery/mockery": "^1.6", + "orchestra/testbench": "^9.0", + "pestphp/pest": "^2.0", + "pestphp/pest-plugin-laravel": "^2.2", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.x-dev" + }, + "laravel": { + "providers": [ + "JoelButcher\\Socialstream\\SocialstreamServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "JoelButcher\\Socialstream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joel Butcher", + "email": "joel@joelbutcher.co.uk" + } + ], + "description": "Get started with OAuth and Laravel", + "keywords": [ + "SocialStream", + "laravel", + "laravel socialite", + "oauth" + ], + "support": { + "issues": "https://github.com/joelbutcher/socialstream/issues", + "source": "https://github.com/joelbutcher/socialstream" + }, + "funding": [ + { + "url": "https://paypal.me/joelbutcher", + "type": "custom" + }, + { + "url": "https://github.com/joelbutcher", + "type": "github" + } + ], + "time": "2024-05-18T14:47:51+00:00" + }, { "name": "kirschbaum-development/eloquent-power-joins", "version": "3.5.6", @@ -2294,6 +2542,71 @@ ], "time": "2024-02-16T16:06:16+00:00" }, + { + "name": "laravel/fortify", + "version": "v1.21.3", + "source": { + "type": "git", + "url": "https://github.com/laravel/fortify.git", + "reference": "a725684d17959c4750f3b441ff2e94ecde7793a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/fortify/zipball/a725684d17959c4750f3b441ff2e94ecde7793a1", + "reference": "a725684d17959c4750f3b441ff2e94ecde7793a1", + "shasum": "" + }, + "require": { + "bacon/bacon-qr-code": "^3.0", + "ext-json": "*", + "illuminate/support": "^10.0|^11.0", + "php": "^8.1", + "pragmarx/google2fa": "^8.0", + "symfony/console": "^6.0|^7.0" + }, + "require-dev": { + "mockery/mockery": "^1.0", + "orchestra/testbench": "^8.16|^9.0", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "laravel": { + "providers": [ + "Laravel\\Fortify\\FortifyServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Fortify\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Backend controllers and scaffolding for Laravel authentication.", + "keywords": [ + "auth", + "laravel" + ], + "support": { + "issues": "https://github.com/laravel/fortify/issues", + "source": "https://github.com/laravel/fortify" + }, + "time": "2024-05-08T18:07:38+00:00" + }, { "name": "laravel/framework", "version": "v11.10.0", @@ -2499,6 +2812,73 @@ }, "time": "2024-06-04T13:45:55+00:00" }, + { + "name": "laravel/jetstream", + "version": "v5.1.2", + "source": { + "type": "git", + "url": "https://github.com/laravel/jetstream.git", + "reference": "cdcd6fad35a369080f37420cbcc0124756af9710" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/jetstream/zipball/cdcd6fad35a369080f37420cbcc0124756af9710", + "reference": "cdcd6fad35a369080f37420cbcc0124756af9710", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/console": "^11.0", + "illuminate/support": "^11.0", + "laravel/fortify": "^1.20", + "mobiledetect/mobiledetectlib": "^4.8", + "php": "^8.2.0", + "symfony/console": "^7.0" + }, + "require-dev": { + "inertiajs/inertia-laravel": "^1.0", + "laravel/sanctum": "^4.0", + "livewire/livewire": "^3.3", + "mockery/mockery": "^1.0", + "orchestra/testbench": "^9.0", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.4" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Jetstream\\JetstreamServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Jetstream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Tailwind scaffolding for the Laravel framework.", + "keywords": [ + "auth", + "laravel", + "tailwind" + ], + "support": { + "issues": "https://github.com/laravel/jetstream/issues", + "source": "https://github.com/laravel/jetstream" + }, + "time": "2024-05-30T14:23:31+00:00" + }, { "name": "laravel/octane", "version": "v2.4.0", @@ -2771,17 +3151,89 @@ "time": "2023-11-08T14:08:06+00:00" }, { - "name": "laravel/tinker", - "version": "v2.9.0", + "name": "laravel/socialite", + "version": "v5.14.0", "source": { "type": "git", - "url": "https://github.com/laravel/tinker.git", - "reference": "502e0fe3f0415d06d5db1f83a472f0f3b754bafe" + "url": "https://github.com/laravel/socialite.git", + "reference": "c7b0193a3753a29aff8ce80aa2f511917e6ed68a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/tinker/zipball/502e0fe3f0415d06d5db1f83a472f0f3b754bafe", - "reference": "502e0fe3f0415d06d5db1f83a472f0f3b754bafe", + "url": "https://api.github.com/repos/laravel/socialite/zipball/c7b0193a3753a29aff8ce80aa2f511917e6ed68a", + "reference": "c7b0193a3753a29aff8ce80aa2f511917e6ed68a", + "shasum": "" + }, + "require": { + "ext-json": "*", + "firebase/php-jwt": "^6.4", + "guzzlehttp/guzzle": "^6.0|^7.0", + "illuminate/contracts": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/http": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", + "league/oauth1-client": "^1.10.1", + "php": "^7.2|^8.0", + "phpseclib/phpseclib": "^3.0" + }, + "require-dev": { + "mockery/mockery": "^1.0", + "orchestra/testbench": "^4.0|^5.0|^6.0|^7.0|^8.0|^9.0", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8.0|^9.3|^10.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + }, + "laravel": { + "providers": [ + "Laravel\\Socialite\\SocialiteServiceProvider" + ], + "aliases": { + "Socialite": "Laravel\\Socialite\\Facades\\Socialite" + } + } + }, + "autoload": { + "psr-4": { + "Laravel\\Socialite\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Laravel wrapper around OAuth 1 & OAuth 2 libraries.", + "homepage": "https://laravel.com", + "keywords": [ + "laravel", + "oauth" + ], + "support": { + "issues": "https://github.com/laravel/socialite/issues", + "source": "https://github.com/laravel/socialite" + }, + "time": "2024-05-03T20:31:38+00:00" + }, + { + "name": "laravel/tinker", + "version": "v2.9.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/tinker.git", + "reference": "502e0fe3f0415d06d5db1f83a472f0f3b754bafe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/tinker/zipball/502e0fe3f0415d06d5db1f83a472f0f3b754bafe", + "reference": "502e0fe3f0415d06d5db1f83a472f0f3b754bafe", "shasum": "" }, "require": { @@ -3300,6 +3752,82 @@ ], "time": "2024-01-28T23:22:08+00:00" }, + { + "name": "league/oauth1-client", + "version": "v1.10.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/oauth1-client.git", + "reference": "d6365b901b5c287dd41f143033315e2f777e1167" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/oauth1-client/zipball/d6365b901b5c287dd41f143033315e2f777e1167", + "reference": "d6365b901b5c287dd41f143033315e2f777e1167", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-openssl": "*", + "guzzlehttp/guzzle": "^6.0|^7.0", + "guzzlehttp/psr7": "^1.7|^2.0", + "php": ">=7.1||>=8.0" + }, + "require-dev": { + "ext-simplexml": "*", + "friendsofphp/php-cs-fixer": "^2.17", + "mockery/mockery": "^1.3.3", + "phpstan/phpstan": "^0.12.42", + "phpunit/phpunit": "^7.5||9.5" + }, + "suggest": { + "ext-simplexml": "For decoding XML-based responses." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev", + "dev-develop": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "League\\OAuth1\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Corlett", + "email": "bencorlett@me.com", + "homepage": "http://www.webcomm.com.au", + "role": "Developer" + } + ], + "description": "OAuth 1.0 Client Library", + "keywords": [ + "Authentication", + "SSO", + "authorization", + "bitbucket", + "identity", + "idp", + "oauth", + "oauth1", + "single sign on", + "trello", + "tumblr", + "twitter" + ], + "support": { + "issues": "https://github.com/thephpleague/oauth1-client/issues", + "source": "https://github.com/thephpleague/oauth1-client/tree/v1.10.1" + }, + "time": "2022-04-15T14:02:14+00:00" + }, { "name": "league/uri", "version": "7.4.1", @@ -3617,6 +4145,70 @@ }, "time": "2024-03-31T07:05:07+00:00" }, + { + "name": "mobiledetect/mobiledetectlib", + "version": "4.8.06", + "source": { + "type": "git", + "url": "https://github.com/serbanghita/Mobile-Detect.git", + "reference": "af088b54cecc13b3264edca7da93a89ba7aa2d9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/af088b54cecc13b3264edca7da93a89ba7aa2d9e", + "reference": "af088b54cecc13b3264edca7da93a89ba7aa2d9e", + "shasum": "" + }, + "require": { + "php": ">=8.0", + "psr/simple-cache": "^2 || ^3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^v3.35.1", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.6", + "squizlabs/php_codesniffer": "^3.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Detection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Serban Ghita", + "email": "serbanghita@gmail.com", + "homepage": "http://mobiledetect.net", + "role": "Developer" + } + ], + "description": "Mobile_Detect is a lightweight PHP class for detecting mobile devices. It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.", + "homepage": "https://github.com/serbanghita/Mobile-Detect", + "keywords": [ + "detect mobile devices", + "mobile", + "mobile detect", + "mobile detector", + "php mobile detect" + ], + "support": { + "issues": "https://github.com/serbanghita/Mobile-Detect/issues", + "source": "https://github.com/serbanghita/Mobile-Detect/tree/4.8.06" + }, + "funding": [ + { + "url": "https://github.com/serbanghita", + "type": "github" + } + ], + "time": "2024-03-01T22:28:42+00:00" + }, { "name": "monolog/monolog", "version": "3.6.0", @@ -4211,6 +4803,123 @@ ], "time": "2024-05-20T09:32:59+00:00" }, + { + "name": "paragonie/constant_time_encoding", + "version": "v2.7.0", + "source": { + "type": "git", + "url": "https://github.com/paragonie/constant_time_encoding.git", + "reference": "52a0d99e69f56b9ec27ace92ba56897fe6993105" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/52a0d99e69f56b9ec27ace92ba56897fe6993105", + "reference": "52a0d99e69f56b9ec27ace92ba56897fe6993105", + "shasum": "" + }, + "require": { + "php": "^7|^8" + }, + "require-dev": { + "phpunit/phpunit": "^6|^7|^8|^9", + "vimeo/psalm": "^1|^2|^3|^4" + }, + "type": "library", + "autoload": { + "psr-4": { + "ParagonIE\\ConstantTime\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com", + "role": "Maintainer" + }, + { + "name": "Steve 'Sc00bz' Thomas", + "email": "steve@tobtu.com", + "homepage": "https://www.tobtu.com", + "role": "Original Developer" + } + ], + "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", + "keywords": [ + "base16", + "base32", + "base32_decode", + "base32_encode", + "base64", + "base64_decode", + "base64_encode", + "bin2hex", + "encoding", + "hex", + "hex2bin", + "rfc4648" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/constant_time_encoding/issues", + "source": "https://github.com/paragonie/constant_time_encoding" + }, + "time": "2024-05-08T12:18:48+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v9.99.100", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", + "shasum": "" + }, + "require": { + "php": ">= 7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/random_compat/issues", + "source": "https://github.com/paragonie/random_compat" + }, + "time": "2020-10-15T08:29:30+00:00" + }, { "name": "phpoption/phpoption", "version": "1.9.2", @@ -4286,6 +4995,168 @@ ], "time": "2023-11-12T21:59:55+00:00" }, + { + "name": "phpseclib/phpseclib", + "version": "3.0.37", + "source": { + "type": "git", + "url": "https://github.com/phpseclib/phpseclib.git", + "reference": "cfa2013d0f68c062055180dd4328cc8b9d1f30b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/cfa2013d0f68c062055180dd4328cc8b9d1f30b8", + "reference": "cfa2013d0f68c062055180dd4328cc8b9d1f30b8", + "shasum": "" + }, + "require": { + "paragonie/constant_time_encoding": "^1|^2", + "paragonie/random_compat": "^1.4|^2.0|^9.99.99", + "php": ">=5.6.1" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-dom": "Install the DOM extension to load XML formatted public keys.", + "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", + "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", + "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", + "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." + }, + "type": "library", + "autoload": { + "files": [ + "phpseclib/bootstrap.php" + ], + "psr-4": { + "phpseclib3\\": "phpseclib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jim Wigginton", + "email": "terrafrost@php.net", + "role": "Lead Developer" + }, + { + "name": "Patrick Monnerat", + "email": "pm@datasphere.ch", + "role": "Developer" + }, + { + "name": "Andreas Fischer", + "email": "bantu@phpbb.com", + "role": "Developer" + }, + { + "name": "Hans-Jürgen Petrich", + "email": "petrich@tronic-media.com", + "role": "Developer" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "role": "Developer" + } + ], + "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", + "homepage": "http://phpseclib.sourceforge.net", + "keywords": [ + "BigInteger", + "aes", + "asn.1", + "asn1", + "blowfish", + "crypto", + "cryptography", + "encryption", + "rsa", + "security", + "sftp", + "signature", + "signing", + "ssh", + "twofish", + "x.509", + "x509" + ], + "support": { + "issues": "https://github.com/phpseclib/phpseclib/issues", + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.37" + }, + "funding": [ + { + "url": "https://github.com/terrafrost", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpseclib", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", + "type": "tidelift" + } + ], + "time": "2024-03-03T02:14:58+00:00" + }, + { + "name": "pragmarx/google2fa", + "version": "v8.0.1", + "source": { + "type": "git", + "url": "https://github.com/antonioribeiro/google2fa.git", + "reference": "80c3d801b31fe165f8fe99ea085e0a37834e1be3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/antonioribeiro/google2fa/zipball/80c3d801b31fe165f8fe99ea085e0a37834e1be3", + "reference": "80c3d801b31fe165f8fe99ea085e0a37834e1be3", + "shasum": "" + }, + "require": { + "paragonie/constant_time_encoding": "^1.0|^2.0", + "php": "^7.1|^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.18", + "phpunit/phpunit": "^7.5.15|^8.5|^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "PragmaRX\\Google2FA\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Antonio Carlos Ribeiro", + "email": "acr@antoniocarlosribeiro.com", + "role": "Creator & Designer" + } + ], + "description": "A One Time Password Authentication package, compatible with Google Authenticator.", + "keywords": [ + "2fa", + "Authentication", + "Two Factor Authentication", + "google2fa" + ], + "support": { + "issues": "https://github.com/antonioribeiro/google2fa/issues", + "source": "https://github.com/antonioribeiro/google2fa/tree/v8.0.1" + }, + "time": "2022-06-13T21:57:56+00:00" + }, { "name": "psr/cache", "version": "3.0.0", @@ -5307,6 +6178,82 @@ ], "time": "2024-03-20T07:29:11+00:00" }, + { + "name": "stephenjude/filament-jetstream", + "version": "0.0.11", + "source": { + "type": "git", + "url": "https://github.com/stephenjude/filament-jetstream.git", + "reference": "567ec4bb5d1f0b79ad8ee7c55ce9e4649918dca9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stephenjude/filament-jetstream/zipball/567ec4bb5d1f0b79ad8ee7c55ce9e4649918dca9", + "reference": "567ec4bb5d1f0b79ad8ee7c55ce9e4649918dca9", + "shasum": "" + }, + "require": { + "filament/filament": "^3.0", + "illuminate/contracts": "^10.0|^11.0", + "laravel/jetstream": "^4.2|^5.0", + "php": "^8.1", + "spatie/laravel-package-tools": "^1.15.0" + }, + "require-dev": { + "larastan/larastan": "^2.9", + "laravel/pint": "^1.0", + "nunomaduro/collision": "^7.9|^8.0", + "orchestra/testbench": "^8.14|^9.0", + "pestphp/pest": "^2.0", + "pestphp/pest-plugin-arch": "^2.0", + "pestphp/pest-plugin-laravel": "^2.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "FilamentJetstream\\FilamentJetstream\\FilamentJetstreamServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "FilamentJetstream\\FilamentJetstream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "stephenjude", + "email": "stephenjudesuccess@gmail.com", + "role": "Developer" + } + ], + "description": "Supercharge your Filament Admin Panel with Laravel Jetstream.", + "homepage": "https://github.com/stephenjude/filament-jetstream", + "keywords": [ + "filament-jetstream", + "laravel", + "stephenjude" + ], + "support": { + "issues": "https://github.com/stephenjude/filament-jetstream/issues", + "source": "https://github.com/stephenjude/filament-jetstream" + }, + "funding": [ + { + "url": "https://github.com/stephenjude", + "type": "github" + } + ], + "time": "2024-06-12T12:45:20+00:00" + }, { "name": "symfony/clock", "version": "v7.1.1", diff --git a/config/app.php b/config/app.php index e25a796..611b463 100644 --- a/config/app.php +++ b/config/app.php @@ -159,6 +159,7 @@ /* * Package Service Providers... */ + JoelButcher\Socialstream\Filament\SocialstreamPanelProvider::class, /* * Application Service Providers... diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 584104c..5256b7a 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -2,20 +2,19 @@ namespace Database\Factories; +use App\Models\ConnectedAccount; +use App\Models\Team; +use App\Models\User; use Illuminate\Database\Eloquent\Factories\Factory; -use Illuminate\Support\Facades\Hash; use Illuminate\Support\Str; +use JoelButcher\Socialstream\Providers; +use Laravel\Jetstream\Features as JetstreamFeatures; /** * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User> */ class UserFactory extends Factory { - /** - * The current password being used by the factory. - */ - protected static ?string $password; - /** * Define the model's default state. * @@ -27,8 +26,12 @@ public function definition(): array 'name' => fake()->name(), 'email' => fake()->unique()->safeEmail(), 'email_verified_at' => now(), - 'password' => static::$password ??= Hash::make('password'), + 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password + 'two_factor_secret' => null, + 'two_factor_recovery_codes' => null, 'remember_token' => Str::random(10), + 'profile_photo_path' => null, + 'current_team_id' => null, ]; } @@ -41,4 +44,45 @@ public function unverified(): static 'email_verified_at' => null, ]); } + + /** + * Indicate that the user should have a personal team. + */ + public function withPersonalTeam(callable $callback = null): static + { + if (! JetstreamFeatures::hasTeamFeatures()) { + return $this->state([]); + } + + return $this->has( + Team::factory() + ->state(fn (array $attributes, User $user) => [ + 'name' => $user->name.'\'s Team', + 'user_id' => $user->id, + 'personal_team' => true, + ]) + ->when(is_callable($callback), $callback), + 'ownedTeams' + ); + } + + /** + * Indicate that the user should have a connected account for the given provider. + */ + public function withConnectedAccount(string $provider, callable $callback = null): static + { + if (! Providers::enabled($provider)) { + return $this->state([]); + } + + return $this->has( + ConnectedAccount::factory() + ->state(fn (array $attributes, User $user) => [ + 'provider' => $provider, + 'user_id' => $user->id, + ]) + ->when(is_callable($callback), $callback), + 'ownedTeams' + ); + } } diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index 638ec96..d23b99e 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -20,7 +20,7 @@ @if (Route::has('login'))
@auth - Home + Dashboard @else Log in diff --git a/routes/web.php b/routes/web.php index 48b42a2..5796980 100644 --- a/routes/web.php +++ b/routes/web.php @@ -90,3 +90,4 @@ +require __DIR__.'/socialstream.php'; \ No newline at end of file