feature flags and a bit on the design

This commit is contained in:
Doar Mihai
2026-02-15 16:24:47 +02:00
parent 4bc77d455b
commit 5a0e6e4165
22 changed files with 663 additions and 102 deletions
+16
View File
@@ -0,0 +1,16 @@
<?php
namespace App\Features;
use Illuminate\Support\Lottery;
class UpVotes
{
/**
* Resolve the feature's initial value.
*/
public function resolve(mixed $scope): mixed
{
return false;
}
}
+19
View File
@@ -0,0 +1,19 @@
<?php
namespace App\Features;
use Illuminate\Support\Lottery;
use Laravel\Pennant\Attributes\Name;
use Laravel\Pennant\Feature;
#[Name('WaitlistPage')]
class WaitlistPage
{
/**
* Resolve the feature's initial value.
*/
public function resolve(mixed $scope): mixed
{
return Feature::active('WaitlistPage');
}
}
@@ -0,0 +1,37 @@
<?php
namespace App\Http\Controllers;
use App\Mail\WaitlistWelcome;
use App\Models\WaitlistEntry;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;
use Illuminate\Validation\ValidationException;
class WaitlistController extends Controller
{
public function index()
{
return view('waitlist.index');
}
public function store(Request $request)
{
$request->validate([
'email' => 'required|email|unique:waitlist_entries,email',
]);
try {
$entry = WaitlistEntry::create([
'email' => $request->email,
]);
// Send welcome email
Mail::to($entry->email)->send(new WaitlistWelcome($entry));
return redirect()->back()->with('success', 'Thank you for joining our waitlist! Check your email for confirmation.');
} catch (\Exception $e) {
return redirect()->back()->with('error', 'Something went wrong. Please try again.');
}
}
}
+55
View File
@@ -0,0 +1,55 @@
<?php
namespace App\Mail;
use App\Models\WaitlistEntry;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class WaitlistWelcome extends Mailable
{
use Queueable, SerializesModels;
/**
* Create a new message instance.
*/
public function __construct(
public WaitlistEntry $entry
) {
//
}
/**
* Get the message envelope.
*/
public function envelope(): Envelope
{
return new Envelope(
subject: 'Welcome to Best Tech From EU Waitlist!',
);
}
/**
* Get the message content definition.
*/
public function content(): Content
{
return new Content(
view: 'emails.waitlist-welcome',
);
}
/**
* Get the attachments for the message.
*
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
*/
public function attachments(): array
{
return [];
}
}
+8
View File
@@ -40,6 +40,14 @@ class Product extends Model
];
}
/**
* Get the route key for the model.
*/
public function getRouteKeyName(): string
{
return 'slug';
}
/**
* Boot the model.
*/
+17
View File
@@ -0,0 +1,17 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class WaitlistEntry extends Model
{
protected $fillable = [
'email',
'notified',
];
protected $casts = [
'notified' => 'boolean',
];
}
+1
View File
@@ -11,6 +11,7 @@
"require": {
"php": "^8.2",
"laravel/framework": "^12.0",
"laravel/pennant": "^1.19",
"laravel/tinker": "^2.10.1",
"laravel/ui": "^4.6"
},
Generated
+78 -2
View File
@@ -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": "776ad1a776065eb04993dfac52d589d9",
"content-hash": "0b95f28c522a9fba5c9596c0f5187864",
"packages": [
{
"name": "brick/math",
@@ -1274,6 +1274,82 @@
},
"time": "2026-01-28T03:40:49+00:00"
},
{
"name": "laravel/pennant",
"version": "v1.19.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/pennant.git",
"reference": "178c654f10db832161b28c872f4b10035000c054"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/pennant/zipball/178c654f10db832161b28c872f4b10035000c054",
"reference": "178c654f10db832161b28c872f4b10035000c054",
"shasum": ""
},
"require": {
"illuminate/console": "^10.0|^11.0|^12.0",
"illuminate/container": "^10.0|^11.0|^12.0",
"illuminate/contracts": "^10.0|^11.0|^12.0",
"illuminate/database": "^10.0|^11.0|^12.0",
"illuminate/queue": "^10.0|^11.0|^12.0",
"illuminate/support": "^10.0|^11.0|^12.0",
"php": "^8.1",
"symfony/console": "^6.0|^7.0",
"symfony/finder": "^6.0|^7.0"
},
"require-dev": {
"laravel/octane": "^1.4|^2.0",
"orchestra/testbench": "^8.36|^9.15|^10.8",
"phpstan/phpstan": "^1.10"
},
"type": "library",
"extra": {
"laravel": {
"aliases": {
"Feature": "Laravel\\Pennant\\Feature"
},
"providers": [
"Laravel\\Pennant\\PennantServiceProvider"
]
},
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"autoload": {
"files": [
"src/helpers.php"
],
"psr-4": {
"Laravel\\Pennant\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "A simple, lightweight library for managing feature flags.",
"homepage": "https://github.com/laravel/pennant",
"keywords": [
"feature",
"flags",
"laravel",
"pennant"
],
"support": {
"issues": "https://github.com/laravel/pennant/issues",
"source": "https://github.com/laravel/pennant"
},
"time": "2026-02-02T05:44:53+00:00"
},
{
"name": "laravel/prompts",
"version": "v0.3.11",
@@ -9405,5 +9481,5 @@
"php": "^8.2"
},
"platform-dev": {},
"plugin-api-version": "2.6.0"
"plugin-api-version": "2.9.0"
}
+44
View File
@@ -0,0 +1,44 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Pennant Store
|--------------------------------------------------------------------------
|
| Here you will specify the default store that Pennant should use when
| storing and resolving feature flag values. Pennant ships with the
| ability to store flag values in an in-memory array or database.
|
| Supported: "array", "database"
|
*/
'default' => env('PENNANT_STORE', 'database'),
/*
|--------------------------------------------------------------------------
| Pennant Stores
|--------------------------------------------------------------------------
|
| Here you may configure each of the stores that should be available to
| Pennant. These stores shall be used to store resolved feature flag
| values - you may configure as many as your application requires.
|
*/
'stores' => [
'array' => [
'driver' => 'array',
],
'database' => [
'driver' => 'database',
'connection' => null,
'table' => 'features',
],
],
];
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Laravel\Pennant\Migrations\PennantMigration;
return new class extends PennantMigration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('features', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('scope');
$table->text('value');
$table->timestamps();
$table->unique(['name', 'scope']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('features');
}
};
@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('waitlist_entries', function (Blueprint $table) {
$table->id();
$table->string('email')->unique();
$table->boolean('notified')->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('waitlist_entries');
}
};
+10 -10
View File
@@ -4,21 +4,21 @@
<div class="min-h-screen flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
<div class="max-w-md w-full space-y-8">
<div>
<h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900">
<h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900 dark:text-white">
{{ __('Login') }}
</h2>
</div>
<div class="bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10">
<div class="bg-white dark:bg-gray-800 py-8 px-4 shadow sm:rounded-lg sm:px-10">
<form method="POST" action="{{ route('login') }}" class="space-y-6">
@csrf
<div>
<label for="email" class="block text-sm font-medium text-gray-700">
<label for="email" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
{{ __('Email Address') }}
</label>
<div class="mt-1">
<input id="email" type="email" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus
class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('email') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
class="appearance-none block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('email') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
@error('email')
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
@enderror
@@ -26,12 +26,12 @@
</div>
<div>
<label for="password" class="block text-sm font-medium text-gray-700">
<label for="password" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
{{ __('Password') }}
</label>
<div class="mt-1">
<input id="password" type="password" name="password" required autocomplete="current-password"
class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('password') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
class="appearance-none block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('password') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
@error('password')
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
@enderror
@@ -41,8 +41,8 @@
<div class="flex items-center justify-between">
<div class="flex items-center">
<input id="remember" name="remember" type="checkbox" {{ old('remember') ? 'checked' : '' }}
class="h-4 w-4 text-primary-600 focus:ring-primary-500 border-gray-300 rounded">
<label for="remember" class="ml-2 block text-sm text-gray-900">
class="h-4 w-4 text-primary-600 focus:ring-primary-500 border-gray-300 dark:border-gray-600 dark:bg-gray-700 rounded">
<label for="remember" class="ml-2 block text-sm text-gray-900 dark:text-gray-300">
{{ __('Remember Me') }}
</label>
</div>
@@ -65,8 +65,8 @@
@if (Route::has('register'))
<div class="text-sm text-center">
<span class="text-gray-600">{{ __("Don't have an account?") }}</span>
<a href="{{ route('register') }}" class="font-medium text-primary-600 hover:text-primary-500">
<span class="text-gray-600 dark:text-gray-400">{{ __("Don't have an account?") }}</span>
<a href="{{ route('register') }}" class="font-medium text-primary-600 dark:text-primary-400 hover:text-primary-500 dark:hover:text-primary-300">
{{ __('Register') }}
</a>
</div>
@@ -4,23 +4,23 @@
<div class="min-h-screen flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
<div class="max-w-md w-full space-y-8">
<div>
<h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900">
<h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900 dark:text-white">
{{ __('Reset Password') }}
</h2>
</div>
<div class="bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10">
<div class="bg-white dark:bg-gray-800 py-8 px-4 shadow sm:rounded-lg sm:px-10">
<form method="POST" action="{{ route('password.update') }}" class="space-y-6">
@csrf
<input type="hidden" name="token" value="{{ $token }}">
<div>
<label for="email" class="block text-sm font-medium text-gray-700">
<label for="email" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
{{ __('Email Address') }}
</label>
<div class="mt-1">
<input id="email" type="email" name="email" value="{{ $email ?? old('email') }}" required autocomplete="email" autofocus
class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('email') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
class="appearance-none block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('email') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
@error('email')
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
@enderror
@@ -28,12 +28,12 @@
</div>
<div>
<label for="password" class="block text-sm font-medium text-gray-700">
<label for="password" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
{{ __('Password') }}
</label>
<div class="mt-1">
<input id="password" type="password" name="password" required autocomplete="new-password"
class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('password') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
class="appearance-none block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('password') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
@error('password')
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
@enderror
@@ -41,12 +41,12 @@
</div>
<div>
<label for="password-confirm" class="block text-sm font-medium text-gray-700">
<label for="password-confirm" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
{{ __('Confirm Password') }}
</label>
<div class="mt-1">
<input id="password-confirm" type="password" name="password_confirmation" required autocomplete="new-password"
class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm">
class="appearance-none block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm">
</div>
</div>
+11 -11
View File
@@ -4,21 +4,21 @@
<div class="min-h-screen flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
<div class="max-w-md w-full space-y-8">
<div>
<h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900">
<h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900 dark:text-white">
{{ __('Register') }}
</h2>
</div>
<div class="bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10">
<div class="bg-white dark:bg-gray-800 py-8 px-4 shadow sm:rounded-lg sm:px-10">
<form method="POST" action="{{ route('register') }}" class="space-y-6">
@csrf
<div>
<label for="name" class="block text-sm font-medium text-gray-700">
<label for="name" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
{{ __('Name') }}
</label>
<div class="mt-1">
<input id="name" type="text" name="name" value="{{ old('name') }}" required autocomplete="name" autofocus
class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('name') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
class="appearance-none block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('name') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
@error('name')
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
@enderror
@@ -26,12 +26,12 @@
</div>
<div>
<label for="email" class="block text-sm font-medium text-gray-700">
<label for="email" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
{{ __('Email Address') }}
</label>
<div class="mt-1">
<input id="email" type="email" name="email" value="{{ old('email') }}" required autocomplete="email"
class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('email') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
class="appearance-none block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('email') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
@error('email')
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
@enderror
@@ -39,12 +39,12 @@
</div>
<div>
<label for="password" class="block text-sm font-medium text-gray-700">
<label for="password" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
{{ __('Password') }}
</label>
<div class="mt-1">
<input id="password" type="password" name="password" required autocomplete="new-password"
class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('password') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
class="appearance-none block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('password') border-red-300 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror">
@error('password')
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
@enderror
@@ -52,12 +52,12 @@
</div>
<div>
<label for="password-confirm" class="block text-sm font-medium text-gray-700">
<label for="password-confirm" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
{{ __('Confirm Password') }}
</label>
<div class="mt-1">
<input id="password-confirm" type="password" name="password_confirmation" required autocomplete="new-password"
class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm">
class="appearance-none block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm">
</div>
</div>
@@ -70,7 +70,7 @@
@if (Route::has('login'))
<div class="text-sm text-center">
<span class="text-gray-600">{{ __("Already have an account?") }}</span>
<span class="text-gray-600 dark:text-gray-400">{{ __("Already have an account?") }}</span>
<a href="{{ route('login') }}" class="font-medium text-primary-600 hover:text-primary-500">
{{ __('Login') }}
</a>
@@ -1,6 +1,6 @@
<button
type="button"
onclick="window.toggleTheme()"
onclick="toggleTheme()"
class="p-2 rounded-md text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 dark:focus:ring-offset-gray-900 transition-colors"
aria-label="Toggle theme">
<!-- Sun icon (visible in dark mode) -->
@@ -12,3 +12,18 @@
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"></path>
</svg>
</button>
<script>
function toggleTheme() {
const html = document.documentElement;
const isDark = html.classList.contains('dark');
if (isDark) {
html.classList.remove('dark');
localStorage.setItem('theme', 'light');
} else {
html.classList.add('dark');
localStorage.setItem('theme', 'dark');
}
}
</script>
@@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome to Best Tech From EU</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
line-height: 1.6;
color: #333;
max-width: 600px;
margin: 0 auto;
padding: 20px;
}
.header {
text-align: center;
padding: 20px 0;
border-bottom: 2px solid #4F46E5;
}
.logo {
font-size: 24px;
font-weight: bold;
color: #4F46E5;
}
.content {
padding: 30px 0;
}
.button {
display: inline-block;
padding: 12px 24px;
background-color: #4F46E5;
color: white;
text-decoration: none;
border-radius: 6px;
margin: 20px 0;
}
.footer {
text-align: center;
padding-top: 20px;
border-top: 1px solid #E5E7EB;
color: #6B7280;
font-size: 14px;
}
</style>
</head>
<body>
<div class="header">
<div class="logo">Best Tech From EU</div>
</div>
<div class="content">
<h1>Welcome to the Waitlist!</h1>
<p>Thank you for joining our waitlist at <strong>{{ $entry->email }}</strong>!</p>
<p>We're building a platform to showcase the best tech products from the European Union. You'll be among the first to know when we launch.</p>
<p><strong>What's next?</strong></p>
<ul>
<li>We'll notify you as soon as the platform launches</li>
<li>You'll get early access to submit your products</li>
<li>Be part of a community celebrating EU tech innovation</li>
</ul>
<p>We're excited to have you on board!</p>
<p>Best regards,<br>The Best Tech From EU Team</p>
</div>
<div class="footer">
<p>&copy; {{ date('Y') }} Best Tech From EU. All rights reserved.</p>
</div>
</body>
</html>
+3 -3
View File
@@ -42,13 +42,13 @@
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<!-- Filters & Sorting -->
<div class="mb-8">
<div class="bg-white rounded-xl shadow-sm border border-gray-200 p-6">
<div class="bg-white dark:bg-gray-800 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700 p-6">
<form method="GET" action="{{ route('products.index') }}" class="space-y-4 lg:space-y-0" x-data="{ showFilters: false }">
<!-- Filter Toggle (Mobile) -->
<div class="lg:hidden mb-4">
<button @click="showFilters = !showFilters"
type="button"
class="w-full inline-flex items-center justify-between px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
class="w-full inline-flex items-center justify-between px-4 py-2 border border-gray-300 dark:border-gray-600 shadow-sm text-sm font-medium rounded-md text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
<span class="flex items-center">
<svg class="mr-2 h-5 w-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"></path>
@@ -126,7 +126,7 @@
Apply
</button>
<a href="{{ route('products.index') }}"
class="flex-1 lg:flex-none inline-flex items-center justify-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
class="flex-1 lg:flex-none inline-flex items-center justify-center px-4 py-2 border border-gray-300 dark:border-gray-600 shadow-sm text-sm font-medium rounded-md text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
<svg class="mr-2 h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
</svg>
+36 -36
View File
@@ -18,13 +18,13 @@
</div>
@endif
<div class="bg-white rounded-lg shadow-sm border border-gray-200">
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700">
<!-- Product Header -->
<div class="px-6 py-8 border-b border-gray-200">
<div class="px-6 py-8 border-b border-gray-200 dark:border-gray-700">
<div class="flex flex-col md:flex-row md:items-start md:justify-between gap-4">
<div class="flex-1">
<div class="flex items-center gap-3 mb-3">
<h1 class="text-3xl font-bold text-gray-900">{{ $product->title }}</h1>
<h1 class="text-3xl font-bold text-gray-900 dark:text-white">{{ $product->title }}</h1>
<!-- Status Badges -->
@if($product->isPending())
@@ -42,8 +42,8 @@
@endif
</div>
<div class="flex items-center gap-3 text-sm text-gray-600">
<span class="inline-flex items-center px-2.5 py-0.5 rounded-md bg-primary-100 text-primary-800 font-medium">
<div class="flex items-center gap-3 text-sm text-gray-600 dark:text-gray-400">
<span class="inline-flex items-center px-2.5 py-0.5 rounded-md bg-primary-100 dark:bg-primary-900 text-primary-800 dark:text-primary-200 font-medium">
{{ $product->category->name }}
</span>
<span>•</span>
@@ -60,7 +60,7 @@
@auth
<!-- Upvote Button -->
<button
class="upvote-btn flex items-center gap-2 px-4 py-2 rounded-md border transition-colors {{ $product->isUpvotedBy(auth()->user()) ? 'border-primary-500 bg-primary-50 text-primary-700' : 'border-gray-300 bg-white text-gray-700 hover:border-primary-500 hover:bg-primary-50' }}"
class="upvote-btn flex items-center gap-2 px-4 py-2 rounded-md border transition-colors {{ $product->isUpvotedBy(auth()->user()) ? 'border-primary-500 bg-primary-50 dark:bg-primary-900 text-primary-700 dark:text-primary-200' : 'border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:border-primary-500 hover:bg-primary-50 dark:hover:bg-primary-900' }}"
data-product-id="{{ $product->id }}"
data-upvoted="{{ $product->isUpvotedBy(auth()->user()) ? 'true' : 'false' }}">
<svg class="h-5 w-5" fill="{{ $product->isUpvotedBy(auth()->user()) ? 'currentColor' : 'none' }}" stroke="currentColor" viewBox="0 0 24 24">
@@ -71,7 +71,7 @@
<!-- Bookmark Button -->
<button
class="bookmark-btn p-2 rounded-md border transition-colors {{ $product->isBookmarkedBy(auth()->user()) ? 'border-primary-500 bg-primary-50 text-primary-700' : 'border-gray-300 bg-white text-gray-700 hover:border-gray-400' }}"
class="bookmark-btn p-2 rounded-md border transition-colors {{ $product->isBookmarkedBy(auth()->user()) ? 'border-primary-500 bg-primary-50 dark:bg-primary-900 text-primary-700 dark:text-primary-200' : 'border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:border-gray-400 dark:hover:border-gray-500' }}"
data-product-id="{{ $product->id }}"
data-bookmarked="{{ $product->isBookmarkedBy(auth()->user()) ? 'true' : 'false' }}">
<svg class="h-5 w-5" fill="{{ $product->isBookmarkedBy(auth()->user()) ? 'currentColor' : 'none' }}" stroke="currentColor" viewBox="0 0 24 24">
@@ -79,7 +79,7 @@
</svg>
</button>
@else
<div class="flex items-center gap-2 px-4 py-2 rounded-md border border-gray-300 bg-gray-50 text-gray-700">
<div class="flex items-center gap-2 px-4 py-2 rounded-md border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-gray-700 dark:text-gray-300">
<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 15l7-7 7 7"></path>
</svg>
@@ -88,7 +88,7 @@
@endauth
@can('edit-product', $product)
<a href="{{ route('products.edit', $product) }}" class="inline-flex items-center px-3 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">
<a href="{{ route('products.edit', $product) }}" class="inline-flex items-center px-3 py-2 border border-gray-300 dark:border-gray-600 shadow-sm text-sm font-medium rounded-md text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600">
Edit
</a>
@endcan
@@ -97,7 +97,7 @@
<form action="{{ route('products.destroy', $product) }}" method="POST" onsubmit="return confirm('Are you sure you want to delete this product?');">
@csrf
@method('DELETE')
<button type="submit" class="inline-flex items-center px-3 py-2 border border-red-300 shadow-sm text-sm font-medium rounded-md text-red-700 bg-white hover:bg-red-50">
<button type="submit" class="inline-flex items-center px-3 py-2 border border-red-300 dark:border-red-700 shadow-sm text-sm font-medium rounded-md text-red-700 dark:text-red-400 bg-white dark:bg-gray-700 hover:bg-red-50 dark:hover:bg-red-900">
Delete
</button>
</form>
@@ -110,17 +110,17 @@
<div class="px-6 py-8">
<!-- Product Thumbnail -->
@if($product->thumbnail_url)
<div class="mb-8 rounded-lg overflow-hidden border border-gray-200">
<div class="mb-8 rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700">
<img src="{{ $product->thumbnail_url }}"
alt="{{ $product->title }}"
class="w-full h-auto max-h-96 object-contain bg-gray-50">
class="w-full h-auto max-h-96 object-contain bg-gray-50 dark:bg-gray-900">
</div>
@endif
<!-- Product Description -->
<div class="mb-8">
<h2 class="text-xl font-semibold text-gray-900 mb-4">About</h2>
<p class="text-gray-700 text-lg leading-relaxed whitespace-pre-line">{{ $product->description }}</p>
<h2 class="text-xl font-semibold text-gray-900 dark:text-white mb-4">About</h2>
<p class="text-gray-700 dark:text-gray-300 text-lg leading-relaxed whitespace-pre-line">{{ $product->description }}</p>
</div>
<!-- Visit Website Button -->
@@ -138,27 +138,27 @@
<!-- Product Metadata -->
@if($product->isApproved() && $product->approved_at)
<div class="pt-6 border-t border-gray-200">
<div class="pt-6 border-t border-gray-200 dark:border-gray-700">
<dl class="grid grid-cols-1 gap-x-4 gap-y-4 sm:grid-cols-2">
<div>
<dt class="text-sm font-medium text-gray-500">Submitted by</dt>
<dd class="mt-1 text-sm text-gray-900">
<a href="{{ route('profile.show', $product->user) }}" class="hover:text-primary-600">
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Submitted by</dt>
<dd class="mt-1 text-sm text-gray-900 dark:text-white">
<a href="{{ route('profile.show', $product->user) }}" class="hover:text-primary-600 dark:hover:text-primary-400">
{{ $product->user->name }}
</a>
</dd>
</div>
<div>
<dt class="text-sm font-medium text-gray-500">Submitted on</dt>
<dd class="mt-1 text-sm text-gray-900">{{ $product->created_at->format('F j, Y') }}</dd>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Submitted on</dt>
<dd class="mt-1 text-sm text-gray-900 dark:text-white">{{ $product->created_at->format('F j, Y') }}</dd>
</div>
<div>
<dt class="text-sm font-medium text-gray-500">Approved on</dt>
<dd class="mt-1 text-sm text-gray-900">{{ $product->approved_at->format('F j, Y') }}</dd>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Approved on</dt>
<dd class="mt-1 text-sm text-gray-900 dark:text-white">{{ $product->approved_at->format('F j, Y') }}</dd>
</div>
<div>
<dt class="text-sm font-medium text-gray-500">Category</dt>
<dd class="mt-1 text-sm text-gray-900">{{ $product->category->name }}</dd>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Category</dt>
<dd class="mt-1 text-sm text-gray-900 dark:text-white">{{ $product->category->name }}</dd>
</div>
</dl>
</div>
@@ -167,9 +167,9 @@
</div>
<!-- Comments Section -->
<div class="bg-white rounded-lg shadow-sm border border-gray-200 mt-6">
<div class="px-6 py-4 border-b border-gray-200">
<h2 class="text-xl font-semibold text-gray-900">
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 mt-6">
<div class="px-6 py-4 border-b border-gray-200 dark:border-gray-700">
<h2 class="text-xl font-semibold text-gray-900 dark:text-white">
Comments ({{ $product->comments()->count() }})
</h2>
</div>
@@ -200,8 +200,8 @@
</div>
</form>
@else
<div class="text-center py-6 bg-gray-50 rounded-lg mb-8">
<p class="text-gray-600">
<div class="text-center py-6 bg-gray-50 dark:bg-gray-900 rounded-lg mb-8">
<p class="text-gray-600 dark:text-gray-400">
<a href="{{ route('login') }}" class="font-medium text-primary-600 hover:text-primary-500">Log in</a>
to post a comment
</p>
@@ -229,11 +229,11 @@
<div class="flex-1 min-w-0">
<div class="flex items-center justify-between">
<div class="flex items-center gap-2">
<a href="{{ route('profile.show', $comment->user) }}" class="font-medium text-gray-900 hover:text-primary-600">
<a href="{{ route('profile.show', $comment->user) }}" class="font-medium text-gray-900 dark:text-white hover:text-primary-600 dark:hover:text-primary-400">
{{ $comment->user->name }}
</a>
<span class="text-gray-500 text-sm">·</span>
<span class="text-gray-500 text-sm">{{ $comment->created_at->diffForHumans() }}</span>
<span class="text-gray-500 dark:text-gray-400 text-sm">·</span>
<span class="text-gray-500 dark:text-gray-400 text-sm">{{ $comment->created_at->diffForHumans() }}</span>
</div>
@can('delete-comment', $comment)
<form action="{{ route('comments.destroy', $comment) }}" method="POST" onsubmit="return confirm('Are you sure you want to delete this comment?');">
@@ -245,15 +245,15 @@
</form>
@endcan
</div>
<p class="mt-2 text-gray-700 whitespace-pre-line">{{ $comment->body }}</p>
<p class="mt-2 text-gray-700 dark:text-gray-300 whitespace-pre-line">{{ $comment->body }}</p>
</div>
</div>
@empty
<div class="text-center py-12 bg-gray-50 rounded-lg">
<div class="text-center py-12 bg-gray-50 dark:bg-gray-900 rounded-lg">
<svg class="mx-auto h-12 w-12 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"></path>
</svg>
<p class="mt-2 text-gray-600">No comments yet. Be the first to share your thoughts!</p>
<p class="mt-2 text-gray-600 dark:text-gray-400">No comments yet. Be the first to share your thoughts!</p>
</div>
@endforelse
</div>
@@ -287,7 +287,7 @@
<!-- Back Button -->
<div class="mt-6">
<a href="{{ route('products.index') }}" class="inline-flex items-center text-sm font-medium text-gray-600 hover:text-gray-900">
<a href="{{ route('products.index') }}" class="inline-flex items-center text-sm font-medium text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white">
<svg class="mr-2 h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"></path>
</svg>
+28 -28
View File
@@ -1,9 +1,9 @@
@extends('layouts.app')
@section('content')
<div class="bg-white">
<div class="bg-white dark:bg-gray-900">
<!-- Profile Header -->
<div class="bg-gradient-to-br from-primary-50 to-white border-b border-gray-200">
<div class="bg-gradient-to-br from-primary-50 to-white dark:from-gray-800 dark:to-gray-900 border-b border-gray-200 dark:border-gray-700">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<div class="md:flex md:items-center md:justify-between md:space-x-8">
<!-- Avatar & Name -->
@@ -12,20 +12,20 @@
@if($user->avatar_url)
<img src="{{ $user->avatar_url }}"
alt="{{ $user->name }}"
class="h-24 w-24 rounded-full object-cover ring-4 ring-white shadow-lg">
class="h-24 w-24 rounded-full object-cover ring-4 ring-white dark:ring-gray-800 shadow-lg">
@else
<div class="h-24 w-24 rounded-full bg-gradient-to-br from-primary-500 to-accent-500 flex items-center justify-center text-white text-3xl font-bold ring-4 ring-white shadow-lg">
<div class="h-24 w-24 rounded-full bg-gradient-to-br from-primary-500 to-accent-500 flex items-center justify-center text-white text-3xl font-bold ring-4 ring-white dark:ring-gray-800 shadow-lg">
{{ strtoupper(substr($user->name, 0, 1)) }}
</div>
@endif
</div>
<div>
<h1 class="text-3xl font-bold text-gray-900">{{ $user->name }}</h1>
<p class="mt-1 text-base text-gray-500">{{ $user->email }}</p>
<h1 class="text-3xl font-bold text-gray-900 dark:text-white">{{ $user->name }}</h1>
<p class="mt-1 text-base text-gray-500 dark:text-gray-400">{{ $user->email }}</p>
@if($user->roles->isNotEmpty())
<div class="mt-2 flex items-center gap-2">
@foreach($user->roles as $role)
<span class="inline-flex items-center px-2.5 py-0.5 rounded-md text-xs font-medium bg-primary-100 text-primary-800">
<span class="inline-flex items-center px-2.5 py-0.5 rounded-md text-xs font-medium bg-primary-100 dark:bg-primary-900 text-primary-800 dark:text-primary-200">
{{ ucfirst($role->name) }}
</span>
@endforeach
@@ -39,7 +39,7 @@
@if(Auth::id() === $user->id)
<div class="mt-6 md:mt-0">
<a href="{{ route('profile.edit') }}"
class="inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
class="inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 shadow-sm text-sm font-medium rounded-md text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
<svg class="mr-2 h-5 w-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path>
</svg>
@@ -53,23 +53,23 @@
<!-- Bio -->
@if($user->bio)
<div class="mt-6 max-w-3xl">
<p class="text-gray-700 text-base leading-relaxed">{{ $user->bio }}</p>
<p class="text-gray-700 dark:text-gray-300 text-base leading-relaxed">{{ $user->bio }}</p>
</div>
@endif
<!-- Stats -->
<div class="mt-8 grid grid-cols-3 gap-4 sm:gap-6">
<div class="bg-white rounded-lg border border-gray-200 p-4 text-center">
<div class="text-2xl font-bold text-gray-900">{{ $stats['products_count'] }}</div>
<div class="mt-1 text-sm text-gray-600">{{ Str::plural('Product', $stats['products_count']) }}</div>
<div class="bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-4 text-center">
<div class="text-2xl font-bold text-gray-900 dark:text-white">{{ $stats['products_count'] }}</div>
<div class="mt-1 text-sm text-gray-600 dark:text-gray-400">{{ Str::plural('Product', $stats['products_count']) }}</div>
</div>
<div class="bg-white rounded-lg border border-gray-200 p-4 text-center">
<div class="text-2xl font-bold text-gray-900">{{ $stats['total_upvotes'] }}</div>
<div class="mt-1 text-sm text-gray-600">{{ Str::plural('Upvote', $stats['total_upvotes']) }}</div>
<div class="bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-4 text-center">
<div class="text-2xl font-bold text-gray-900 dark:text-white">{{ $stats['total_upvotes'] }}</div>
<div class="mt-1 text-sm text-gray-600 dark:text-gray-400">{{ Str::plural('Upvote', $stats['total_upvotes']) }}</div>
</div>
<div class="bg-white rounded-lg border border-gray-200 p-4 text-center">
<div class="text-2xl font-bold text-gray-900">{{ $stats['comments_count'] }}</div>
<div class="mt-1 text-sm text-gray-600">{{ Str::plural('Comment', $stats['comments_count']) }}</div>
<div class="bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-4 text-center">
<div class="text-2xl font-bold text-gray-900 dark:text-white">{{ $stats['comments_count'] }}</div>
<div class="mt-1 text-sm text-gray-600 dark:text-gray-400">{{ Str::plural('Comment', $stats['comments_count']) }}</div>
</div>
</div>
@@ -80,7 +80,7 @@
<a href="{{ $user->website }}"
target="_blank"
rel="noopener noreferrer"
class="inline-flex items-center px-3 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50">
class="inline-flex items-center px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700">
<svg class="mr-2 h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"></path>
</svg>
@@ -92,7 +92,7 @@
<a href="https://twitter.com/{{ $user->twitter }}"
target="_blank"
rel="noopener noreferrer"
class="inline-flex items-center px-3 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50">
class="inline-flex items-center px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700">
<svg class="mr-2 h-4 w-4" fill="currentColor" viewBox="0 0 24 24">
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"></path>
</svg>
@@ -104,7 +104,7 @@
<a href="https://github.com/{{ $user->github }}"
target="_blank"
rel="noopener noreferrer"
class="inline-flex items-center px-3 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50">
class="inline-flex items-center px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700">
<svg class="mr-2 h-4 w-4" fill="currentColor" viewBox="0 0 24 24">
<path fill-rule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clip-rule="evenodd"></path>
</svg>
@@ -116,7 +116,7 @@
<a href="https://linkedin.com/in/{{ $user->linkedin }}"
target="_blank"
rel="noopener noreferrer"
class="inline-flex items-center px-3 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50">
class="inline-flex items-center px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700">
<svg class="mr-2 h-4 w-4" fill="currentColor" viewBox="0 0 24 24">
<path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"></path>
</svg>
@@ -128,7 +128,7 @@
<!-- Member Since -->
<div class="mt-6">
<p class="text-sm text-gray-500">
<p class="text-sm text-gray-500 dark:text-gray-400">
<svg class="inline-block h-4 w-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
</svg>
@@ -141,10 +141,10 @@
<!-- Products Section -->
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div class="mb-8">
<h2 class="text-2xl font-bold text-gray-900">
<h2 class="text-2xl font-bold text-gray-900 dark:text-white">
Products by {{ $user->name }}
</h2>
<p class="mt-2 text-sm text-gray-600">
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">
@if($products->total() > 0)
Showing {{ $products->count() }} of {{ $products->total() }} {{ Str::plural('product', $products->total()) }}
@else
@@ -167,12 +167,12 @@
</div>
@endif
@else
<div class="text-center py-12 bg-gray-50 rounded-lg border border-gray-200">
<div class="text-center py-12 bg-gray-50 dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700">
<svg class="mx-auto h-12 w-12 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"></path>
</svg>
<h3 class="mt-2 text-sm font-medium text-gray-900">No products</h3>
<p class="mt-1 text-sm text-gray-500">
<h3 class="mt-2 text-sm font-medium text-gray-900 dark:text-white">No products</h3>
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">
{{ Auth::id() === $user->id ? "You haven't submitted any products yet." : "{$user->name} hasn't submitted any products yet." }}
</p>
@auth
+132
View File
@@ -0,0 +1,132 @@
@extends('layouts.app')
@section('content')
<div class="min-h-screen flex items-center justify-center px-4 sm:px-6 lg:px-8 bg-gradient-to-br from-primary-50 to-primary-100 dark:from-gray-900 dark:to-gray-800">
<div class="max-w-2xl w-full space-y-8 text-center">
<!-- Logo/Icon -->
<div class="flex justify-center">
<div class="p-4 bg-primary-600 dark:bg-primary-500 rounded-full">
<svg class="h-16 w-16 text-white" fill="currentColor" viewBox="0 0 24 24">
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"></path>
</svg>
</div>
</div>
<!-- Heading -->
<div>
<h1 class="text-5xl font-extrabold text-gray-900 dark:text-white mb-4">
Discover the Best Tech From EU
</h1>
<p class="text-xl text-gray-600 dark:text-gray-300 max-w-xl mx-auto">
Join our waitlist to be the first to explore and showcase innovative tech products from the European Union.
</p>
</div>
<!-- Success/Error Messages -->
@if(session('success'))
<div class="bg-green-100 dark:bg-green-900 border border-green-400 dark:border-green-700 text-green-700 dark:text-green-300 px-6 py-4 rounded-lg shadow-md">
<div class="flex items-center">
<svg class="w-6 h-6 mr-3" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/>
</svg>
<p class="font-medium">{{ session('success') }}</p>
</div>
</div>
@endif
@if(session('error'))
<div class="bg-red-100 dark:bg-red-900 border border-red-400 dark:border-red-700 text-red-700 dark:text-red-300 px-6 py-4 rounded-lg shadow-md">
<div class="flex items-center">
<svg class="w-6 h-6 mr-3" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/>
</svg>
<p class="font-medium">{{ session('error') }}</p>
</div>
</div>
@endif
@if($errors->any())
<div class="bg-red-100 dark:bg-red-900 border border-red-400 dark:border-red-700 text-red-700 dark:text-red-300 px-6 py-4 rounded-lg shadow-md">
<div class="flex items-start">
<svg class="w-6 h-6 mr-3 flex-shrink-0 mt-0.5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/>
</svg>
<div>
@foreach($errors->all() as $error)
<p class="font-medium">{{ $error }}</p>
@endforeach
</div>
</div>
</div>
@endif
<!-- Waitlist Form -->
<div class="bg-white dark:bg-gray-800 shadow-2xl rounded-2xl p-8 max-w-md mx-auto">
<form action="{{ route('waitlist.store') }}" method="POST" class="space-y-6">
@csrf
<div>
<label for="email" class="block text-sm font-medium text-gray-700 dark:text-gray-300 text-left mb-2">
Email Address
</label>
<input
type="email"
name="email"
id="email"
required
value="{{ old('email') }}"
placeholder="your@email.com"
class="appearance-none block w-full px-4 py-3 border border-gray-300 dark:border-gray-600 rounded-lg shadow-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:text-white text-base"
>
</div>
<button
type="submit"
class="w-full flex justify-center py-3 px-4 border border-transparent rounded-lg shadow-sm text-base font-medium text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 transition-colors duration-200"
>
Join Waitlist
</button>
</form>
</div>
<!-- Features -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 pt-12">
<div class="bg-white dark:bg-gray-800 p-6 rounded-xl shadow-lg">
<div class="text-primary-600 dark:text-primary-400 mb-3">
<svg class="h-10 w-10 mx-auto" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"/>
</svg>
</div>
<h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-2">Early Access</h3>
<p class="text-gray-600 dark:text-gray-300 text-sm">
Be among the first to submit and discover EU tech products
</p>
</div>
<div class="bg-white dark:bg-gray-800 p-6 rounded-xl shadow-lg">
<div class="text-primary-600 dark:text-primary-400 mb-3">
<svg class="h-10 w-10 mx-auto" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"/>
</svg>
</div>
<h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-2">Community</h3>
<p class="text-gray-600 dark:text-gray-300 text-sm">
Join a community celebrating EU tech innovation
</p>
</div>
<div class="bg-white dark:bg-gray-800 p-6 rounded-xl shadow-lg">
<div class="text-primary-600 dark:text-primary-400 mb-3">
<svg class="h-10 w-10 mx-auto" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"/>
</svg>
</div>
<h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-2">Stay Updated</h3>
<p class="text-gray-600 dark:text-gray-300 text-sm">
Get notified when we launch and new features arrive
</p>
</div>
</div>
</div>
</div>
@endsection
+3 -3
View File
@@ -74,13 +74,13 @@
<a href="{{ route('products.index', ['category' => $category->id]) }}"
class="group relative bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 hover:border-primary-500 hover:shadow-md transition-all p-6 flex flex-col items-center justify-center text-center">
<div class="mb-3">
<div class="w-12 h-12 rounded-lg bg-primary-100 group-hover:bg-primary-200 flex items-center justify-center">
<svg class="h-6 w-6 text-primary-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<div class="w-12 h-12 rounded-lg bg-primary-100 dark:bg-primary-900 group-hover:bg-primary-200 dark:group-hover:bg-primary-800 flex items-center justify-center">
<svg class="h-6 w-6 text-primary-600 dark:text-primary-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"></path>
</svg>
</div>
</div>
<h3 class="text-sm font-semibold text-gray-900 group-hover:text-primary-600">{{ $category->name }}</h3>
<h3 class="text-sm font-semibold text-gray-900 dark:text-white group-hover:text-primary-600 dark:group-hover:text-primary-400">{{ $category->name }}</h3>
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">{{ $category->products_count }} {{ Str::plural('product', $category->products_count) }}</p>
</a>
@endforeach
+5
View File
@@ -6,10 +6,15 @@ use App\Http\Controllers\CommentController;
use App\Http\Controllers\ProductController;
use App\Http\Controllers\ProfileController;
use App\Http\Controllers\UpvoteController;
use App\Http\Controllers\WaitlistController;
use Illuminate\Support\Facades\Route;
Route::get('/', [ProductController::class, 'homepage'])->name('homepage');
// Waitlist Routes
Route::get('/waitlist', [WaitlistController::class, 'index'])->name('waitlist.index');
Route::post('/waitlist', [WaitlistController::class, 'store'])->name('waitlist.store');
Auth::routes();
Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');