-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
112 changed files
with
5,985 additions
and
2,508 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Http\Controllers\Api; | ||
|
||
use App\Data\Gallery\GalleryNftData; | ||
use App\Http\Controllers\Controller; | ||
use App\Models\Nft; | ||
use App\Models\User; | ||
use Illuminate\Http\Request; | ||
use Spatie\LaravelData\DataCollection; | ||
|
||
class UserNftController extends Controller | ||
{ | ||
/** | ||
* @return DataCollection<int, GalleryNftData> | ||
*/ | ||
public function __invoke(Request $request): DataCollection | ||
{ | ||
$ids = array_map(fn ($item) => intval($item), explode(',', $request->get('ids', '') ?? '')); | ||
|
||
/** @var User $user */ | ||
$user = $request->user(); | ||
|
||
return GalleryNftData::collection( | ||
$user->nfts() | ||
->whereIn('nfts.id', $ids) | ||
->get() | ||
->sortBy(fn (Nft $nft) => array_search($nft->id, $ids, true)) | ||
->values() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Http\Controllers\Filament; | ||
|
||
use Filament\Facades\Filament; | ||
use Filament\Http\Controllers\Auth\LogoutController as FilamentLogoutController; | ||
use Illuminate\Http\RedirectResponse; | ||
use Illuminate\Http\Request; | ||
|
||
class LogoutController extends FilamentLogoutController | ||
{ | ||
public function logout(Request $request): RedirectResponse | ||
{ | ||
Filament::auth()->logout(); | ||
$request->session()->invalidate(); | ||
$request->session()->regenerateToken(); | ||
|
||
return redirect()->route('galleries'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.