the promoseven group crm

This commit is contained in:
Ghassan Yusuf 2026-01-28 17:19:02 +03:00
commit 12e3a44046
88 changed files with 12923 additions and 0 deletions

18
.editorconfig Normal file
View File

@ -0,0 +1,18 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_size = 2
[compose.yaml]
indent_size = 4

65
.env.example Normal file
View File

@ -0,0 +1,65 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
APP_MAINTENANCE_DRIVER=file
# APP_MAINTENANCE_STORE=database
# PHP_CLI_SERVER_WORKERS=4
BCRYPT_ROUNDS=12
LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=sqlite
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=laravel
# DB_USERNAME=root
# DB_PASSWORD=
SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null
BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database
CACHE_STORE=database
# CACHE_PREFIX=
MEMCACHED_HOST=127.0.0.1
REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=log
MAIL_SCHEME=null
MAIL_HOST=127.0.0.1
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
VITE_APP_NAME="${APP_NAME}"

11
.gitattributes vendored Normal file
View File

@ -0,0 +1,11 @@
* text=auto eol=lf
*.blade.php diff=html
*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php
/.github export-ignore
CHANGELOG.md export-ignore
.styleci.yml export-ignore

24
.gitignore vendored Normal file
View File

@ -0,0 +1,24 @@
*.log
.DS_Store
.env
.env.backup
.env.production
.phpactor.json
.phpunit.result.cache
/.fleet
/.idea
/.nova
/.phpunit.cache
/.vscode
/.zed
/auth.json
/node_modules
/public/build
/public/hot
/public/storage
/storage/*.key
/storage/pail
/vendor
Homestead.json
Homestead.yaml
Thumbs.db

59
README.md Normal file
View File

@ -0,0 +1,59 @@
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
<p align="center">
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
</p>
## About Laravel
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
- [Simple, fast routing engine](https://laravel.com/docs/routing).
- [Powerful dependency injection container](https://laravel.com/docs/container).
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
- [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
Laravel is accessible, powerful, and provides tools required for large, robust applications.
## Learning Laravel
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. You can also check out [Laravel Learn](https://laravel.com/learn), where you will be guided through building a modern Laravel application.
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
## Laravel Sponsors
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).
### Premium Partners
- **[Vehikl](https://vehikl.com)**
- **[Tighten Co.](https://tighten.co)**
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
- **[64 Robots](https://64robots.com)**
- **[Curotec](https://www.curotec.com/services/technologies/laravel)**
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
- **[Redberry](https://redberry.international/laravel-development)**
- **[Active Logic](https://activelogic.com)**
## Contributing
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
## Code of Conduct
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
## Security Vulnerabilities
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
## License
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

View File

@ -0,0 +1,66 @@
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Models\Campaign;
use App\Models\Guest;
use App\Models\Venue;
use App\Models\GuestVisit;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class AdminController extends Controller
{
public function getKpis()
{
$today = now()->toDateString();
return response()->json([
'today_checkins' => GuestVisit::whereDate('visit_date', $today)->count(),
'active_members' => Guest::whereHas('visits', function($q) use ($today) {
$q->whereDate('visit_date', '>=', now()->subDays(30));
})->count(),
'total_guests' => Guest::count(),
'total_visits' => GuestVisit::count(),
'revenue_today' => GuestVisit::whereDate('visit_date', $today)->sum('spend_amount'),
]);
}
public function getCharts()
{
$visitsByVenue = GuestVisit::select('venues.name', DB::raw('count(*) as visits'))
->join('venues', 'guest_visits.venue_id', '=', 'venues.id')
->groupBy('venues.id', 'venues.name')
->get();
$tierDistribution = Guest::select('loyalty_tiers.name', DB::raw('count(*) as count'))
->join('loyalty_tiers', 'guests.tier_id', '=', 'loyalty_tiers.id')
->groupBy('loyalty_tiers.id', 'loyalty_tiers.name')
->get();
return response()->json([
'visits_by_venue' => $visitsByVenue,
'tier_distribution' => $tierDistribution,
]);
}
public function createCampaign(Request $request)
{
$request->validate([
'name' => 'required|string',
'segment_rules' => 'required|array',
'offer_text' => 'required|string',
'voucher_id' => 'required|exists:vouchers,id',
]);
$campaign = Campaign::create($request->all());
return response()->json($campaign, 201);
}
public function getVenues()
{
return response()->json(Venue::all());
}
}

View File

@ -0,0 +1,165 @@
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Models\Guest;
use App\Models\GuestVisit;
use App\Models\GuestTag;
use App\Models\GuestNote;
use App\Services\GuestSearch;
use App\Services\CrossSellEngine;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;
use SimpleSoftwareIO\QrCode\Facades\QrCode;
class GuestController extends Controller
{
protected $guestSearch;
protected $crossSellEngine;
public function __construct(GuestSearch $guestSearch, CrossSellEngine $crossSellEngine)
{
$this->guestSearch = $guestSearch;
$this->crossSellEngine = $crossSellEngine;
}
public function search(Request $request)
{
$query = $request->get('q');
if (!$query) {
return response()->json([]);
}
$guests = $this->guestSearch->search($query);
return response()->json($guests);
}
public function show($id)
{
$guest = Guest::with(['tier', 'visits.venue', 'tags', 'notes.staff'])->findOrFail($id);
return response()->json($guest);
}
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
'name' => 'required|string|max:255',
'phone' => 'required|string|max:20',
'venue_id' => 'required|exists:venues,id',
]);
if ($validator->fails()) {
return response()->json($validator->errors(), 422);
}
$guest = Guest::create([
'name' => $request->name,
'phone' => $request->phone,
'email' => $request->email,
'nationality' => $request->nationality,
'language' => $request->language,
'birthday' => $request->birthday,
'marketing_consent' => $request->marketing_consent ?? false,
]);
$guest->generateLoyaltyId();
// Create initial visit
GuestVisit::create([
'guest_id' => $guest->id,
'venue_id' => $request->venue_id,
'visit_date' => now(),
'visit_type' => 'registration',
]);
return response()->json($guest, 201);
}
public function checkin(Request $request, $id)
{
$validator = Validator::make($request->all(), [
'venue_id' => 'required|exists:venues,id',
'spend_amount' => 'numeric|min:0',
'visit_type' => 'required|in:stay,dining,bar,beach,pool,watersports',
'room_number' => 'nullable|string',
'notes' => 'nullable|string',
]);
if ($validator->fails()) {
return response()->json($validator->errors(), 422);
}
$visit = GuestVisit::create([
'guest_id' => $id,
'venue_id' => $request->venue_id,
'visit_date' => now(),
'spend_amount' => $request->spend_amount ?? 0,
'visit_type' => $request->visit_type,
'room_number' => $request->room_number,
'notes' => $request->notes,
]);
// Update lifetime spend
$guest = Guest::find($id);
$guest->lifetime_spend = $guest->visits()->sum('spend_amount');
$guest->save();
return response()->json($visit, 201);
}
public function getCrossSellSuggestions($id)
{
$suggestions = $this->crossSellEngine->getSuggestions($id);
return response()->json($suggestions);
}
public function addTags(Request $request, $id)
{
$validator = Validator::make($request->all(), [
'tags' => 'required|array',
'tags.*' => 'string',
]);
if ($validator->fails()) {
return response()->json($validator->errors(), 422);
}
foreach ($request->tags as $tagName) {
GuestTag::firstOrCreate([
'guest_id' => $id,
'tag_name' => $tagName,
]);
}
return response()->json(['message' => 'Tags added successfully']);
}
public function addNote(Request $request, $id)
{
$validator = Validator::make($request->all(), [
'note_text' => 'required|string',
]);
if ($validator->fails()) {
return response()->json($validator->errors(), 422);
}
$note = GuestNote::create([
'guest_id' => $id,
'note_text' => $request->note_text,
'staff_id' => auth()->id(),
]);
return response()->json($note, 201);
}
public function generateQrCode($id)
{
$guest = Guest::findOrFail($id);
$qrCode = QrCode::size(200)->generate($guest->loyalty_id);
return response($qrCode)->header('Content-Type', 'image/svg+xml');
}
}

View File

@ -0,0 +1,8 @@
<?php
namespace App\Http\Controllers;
abstract class Controller
{
//
}

View File

@ -0,0 +1,15 @@
<?php
namespace App\Http\Controllers;
use App\Models\Venue;
use Illuminate\Http\Request;
class DashboardController extends Controller
{
public function index()
{
$venues = Venue::all();
return view('dashboard', compact('venues'));
}
}

View File

@ -0,0 +1,23 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class GuestWebController extends Controller
{
public function search()
{
return view('guests.search');
}
public function new()
{
return view('guests.new');
}
public function profile($id)
{
return view('guests.profile', ['guestId' => $id]);
}
}

28
app/Models/Campaign.php Normal file
View File

@ -0,0 +1,28 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Campaign extends Model
{
use HasFactory;
protected $fillable = [
'name',
'segment_rules',
'offer_text',
'voucher_id',
'status',
];
protected $casts = [
'segment_rules' => 'array',
];
public function voucher()
{
return $this->belongsTo(Voucher::class);
}
}

10
app/Models/Guest.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Guest extends Model
{
//
}

27
app/Models/GuestNote.php Normal file
View File

@ -0,0 +1,27 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class GuestNote extends Model
{
use HasFactory;
protected $fillable = [
'guest_id',
'note_text',
'staff_id',
];
public function guest()
{
return $this->belongsTo(Guest::class);
}
public function staff()
{
return $this->belongsTo(User::class, 'staff_id');
}
}

0
app/Models/GuestTag.php Normal file
View File

36
app/Models/GuestVisit.php Normal file
View File

@ -0,0 +1,36 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class GuestVisit extends Model
{
use HasFactory;
protected $fillable = [
'guest_id',
'venue_id',
'visit_date',
'spend_amount',
'visit_type',
'room_number',
'notes',
];
protected $casts = [
'visit_date' => 'datetime',
'spend_amount' => 'decimal:2',
];
public function guest()
{
return $this->belongsTo(Guest::class);
}
public function venue()
{
return $this->belongsTo(Venue::class);
}
}

View File

48
app/Models/User.php Normal file
View File

@ -0,0 +1,48 @@
<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
/** @use HasFactory<\Database\Factories\UserFactory> */
use HasFactory, Notifiable;
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'name',
'email',
'password',
];
/**
* The attributes that should be hidden for serialization.
*
* @var list<string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}
}

0
app/Models/Venue.php Normal file
View File

35
app/Models/Voucher.php Normal file
View File

@ -0,0 +1,35 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Voucher extends Model
{
use HasFactory;
protected $fillable = [
'name',
'description',
'discount_amount',
'valid_venues',
'expiry_date',
];
protected $casts = [
'valid_venues' => 'array',
'expiry_date' => 'datetime',
'discount_amount' => 'decimal:2',
];
public function issuedVouchers()
{
return $this->hasMany(IssuedVoucher::class);
}
public function campaigns()
{
return $this->hasMany(Campaign::class);
}
}

View File

@ -0,0 +1,24 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
//
}
}

View File

@ -0,0 +1,20 @@
<?php
namespace App\Services;
use App\Models\Guest;
use Illuminate\Support\Facades\DB;
class GuestSearch
{
public function search(string $query)
{
return Guest::where('name', 'like', "%{$query}%")
->orWhere('phone', 'like', "%{$query}%")
->orWhere('email', 'like', "%{$query}%")
->orderByRaw("CASE WHEN phone LIKE '%{$query}%' THEN 1 ELSE 2 END")
->orderBy('updated_at', 'desc')
->limit(20)
->get();
}
}

18
artisan Normal file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env php
<?php
use Illuminate\Foundation\Application;
use Symfony\Component\Console\Input\ArgvInput;
define('LARAVEL_START', microtime(true));
// Register the Composer autoloader...
require __DIR__.'/vendor/autoload.php';
// Bootstrap Laravel and handle the command...
/** @var Application $app */
$app = require_once __DIR__.'/bootstrap/app.php';
$status = $app->handleCommand(new ArgvInput);
exit($status);

19
bootstrap/app.php Normal file
View File

@ -0,0 +1,19 @@
<?php
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
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',
)
->withMiddleware(function (Middleware $middleware): void {
//
})
->withExceptions(function (Exceptions $exceptions): void {
//
})->create();

2
bootstrap/cache/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

5
bootstrap/providers.php Normal file
View File

@ -0,0 +1,5 @@
<?php
return [
App\Providers\AppServiceProvider::class,
];

89
composer.json Normal file
View File

@ -0,0 +1,89 @@
{
"$schema": "https://getcomposer.org/schema.json",
"name": "laravel/laravel",
"type": "project",
"description": "The skeleton application for the Laravel framework.",
"keywords": ["laravel", "framework"],
"license": "MIT",
"require": {
"php": "^8.2",
"laravel/framework": "^12.0",
"laravel/sanctum": "^4.0",
"laravel/tinker": "^2.10.1",
"tymon/jwt-auth": "^2.1",
"simplesoftwareio/simple-qrcode": "^4.2"
},
"require-dev": {
"fakerphp/faker": "^1.23",
"laravel/pail": "^1.2.2",
"laravel/pint": "^1.24",
"laravel/sail": "^1.41",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.6",
"phpunit/phpunit": "^11.5.3"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"setup": [
"composer install",
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\"",
"@php artisan key:generate",
"@php artisan migrate --force",
"npm install",
"npm run build"
],
"dev": [
"Composer\\Config::disableProcessTimeout",
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1 --timeout=0\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite --kill-others"
],
"test": [
"@php artisan config:clear --ansi",
"@php artisan test"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi",
"@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
"@php artisan migrate --graceful --ansi"
],
"pre-package-uninstall": [
"Illuminate\\Foundation\\ComposerScripts::prePackageUninstall"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"php-http/discovery": true
}
},
"minimum-stability": "stable",
"prefer-stable": true
}

8445
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

126
config/app.php Normal file
View File

@ -0,0 +1,126 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application, which will be used when the
| framework needs to place the application's name in a notification or
| other UI elements where an application name needs to be displayed.
|
*/
'name' => env('APP_NAME', 'Laravel'),
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services the application utilizes. Set this in your ".env" file.
|
*/
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => (bool) env('APP_DEBUG', false),
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| the application so that it's available within Artisan commands.
|
*/
'url' => env('APP_URL', 'http://localhost'),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. The timezone
| is set to "UTC" by default as it is suitable for most use cases.
|
*/
'timezone' => 'UTC',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by Laravel's translation / localization methods. This option can be
| set to any locale for which you plan to have translation strings.
|
*/
'locale' => env('APP_LOCALE', 'en'),
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is utilized by Laravel's encryption services and should be set
| to a random, 32 character string to ensure that all encrypted values
| are secure. You should do this prior to deploying the application.
|
*/
'cipher' => 'AES-256-CBC',
'key' => env('APP_KEY'),
'previous_keys' => [
...array_filter(
explode(',', (string) env('APP_PREVIOUS_KEYS', ''))
),
],
/*
|--------------------------------------------------------------------------
| Maintenance Mode Driver
|--------------------------------------------------------------------------
|
| These configuration options determine the driver used to determine and
| manage Laravel's "maintenance mode" status. The "cache" driver will
| allow maintenance mode to be controlled across multiple machines.
|
| Supported drivers: "file", "cache"
|
*/
'maintenance' => [
'driver' => env('APP_MAINTENANCE_DRIVER', 'file'),
'store' => env('APP_MAINTENANCE_STORE', 'database'),
],
];

115
config/auth.php Normal file
View File

@ -0,0 +1,115 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option defines the default authentication "guard" and password
| reset "broker" for your application. You may change these values
| as required, but they're a perfect start for most applications.
|
*/
'defaults' => [
'guard' => env('AUTH_GUARD', 'web'),
'passwords' => env('AUTH_PASSWORD_BROKER', 'users'),
],
/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| which utilizes session storage plus the Eloquent user provider.
|
| All authentication guards have a user provider, which defines how the
| users are actually retrieved out of your database or other storage
| system used by the application. Typically, Eloquent is utilized.
|
| Supported: "session"
|
*/
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
],
/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication guards have a user provider, which defines how the
| users are actually retrieved out of your database or other storage
| system used by the application. Typically, Eloquent is utilized.
|
| If you have multiple user tables or models you may configure multiple
| providers to represent the model / table. These providers may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => env('AUTH_MODEL', App\Models\User::class),
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
/*
|--------------------------------------------------------------------------
| Resetting Passwords
|--------------------------------------------------------------------------
|
| These configuration options specify the behavior of Laravel's password
| reset functionality, including the table utilized for token storage
| and the user provider that is invoked to actually retrieve users.
|
| The expiry time is the number of minutes that each reset token will be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
| The throttle setting is the number of seconds a user must wait before
| generating more password reset tokens. This prevents the user from
| quickly generating a very large amount of password reset tokens.
|
*/
'passwords' => [
'users' => [
'provider' => 'users',
'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
'expire' => 60,
'throttle' => 60,
],
],
/*
|--------------------------------------------------------------------------
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the number of seconds before a password confirmation
| window expires and users are asked to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/
'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800),
];

117
config/cache.php Normal file
View File

@ -0,0 +1,117 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Cache Store
|--------------------------------------------------------------------------
|
| This option controls the default cache store that will be used by the
| framework. This connection is utilized if another isn't explicitly
| specified when running a cache operation inside the application.
|
*/
'default' => env('CACHE_STORE', 'database'),
/*
|--------------------------------------------------------------------------
| Cache Stores
|--------------------------------------------------------------------------
|
| Here you may define all of the cache "stores" for your application as
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
| Supported drivers: "array", "database", "file", "memcached",
| "redis", "dynamodb", "octane",
| "failover", "null"
|
*/
'stores' => [
'array' => [
'driver' => 'array',
'serialize' => false,
],
'database' => [
'driver' => 'database',
'connection' => env('DB_CACHE_CONNECTION'),
'table' => env('DB_CACHE_TABLE', 'cache'),
'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'),
'lock_table' => env('DB_CACHE_LOCK_TABLE'),
],
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
'lock_path' => storage_path('framework/cache/data'),
],
'memcached' => [
'driver' => 'memcached',
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
'sasl' => [
env('MEMCACHED_USERNAME'),
env('MEMCACHED_PASSWORD'),
],
'options' => [
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
],
'servers' => [
[
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
'port' => env('MEMCACHED_PORT', 11211),
'weight' => 100,
],
],
],
'redis' => [
'driver' => 'redis',
'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'),
],
'dynamodb' => [
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'endpoint' => env('DYNAMODB_ENDPOINT'),
],
'octane' => [
'driver' => 'octane',
],
'failover' => [
'driver' => 'failover',
'stores' => [
'database',
'array',
],
],
],
/*
|--------------------------------------------------------------------------
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing the APC, database, memcached, Redis, and DynamoDB cache
| stores, there might be other applications using the same cache. For
| that reason, you may prefix every cache key to avoid collisions.
|
*/
'prefix' => env('CACHE_PREFIX', Str::slug((string) env('APP_NAME', 'laravel')).'-cache-'),
];

183
config/database.php Normal file
View File

@ -0,0 +1,183 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for database operations. This is
| the connection which will be utilized unless another connection
| is explicitly specified when you execute a query / statement.
|
*/
'default' => env('DB_CONNECTION', 'sqlite'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Below are all of the database connections defined for your application.
| An example configuration is provided for each database system which
| is supported by Laravel. You're free to add / remove connections.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'url' => env('DB_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
'busy_timeout' => null,
'journal_mode' => null,
'synchronous' => null,
'transaction_mode' => 'DEFERRED',
],
'mysql' => [
'driver' => 'mysql',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => env('DB_CHARSET', 'utf8mb4'),
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
(PHP_VERSION_ID >= 80500 ? \Pdo\Mysql::ATTR_SSL_CA : \PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'mariadb' => [
'driver' => 'mariadb',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => env('DB_CHARSET', 'utf8mb4'),
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
(PHP_VERSION_ID >= 80500 ? \Pdo\Mysql::ATTR_SSL_CA : \PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'prefix_indexes' => true,
'search_path' => 'public',
'sslmode' => env('DB_SSLMODE', 'prefer'),
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DB_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'prefix_indexes' => true,
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run on the database.
|
*/
'migrations' => [
'table' => 'migrations',
'update_date_on_publish' => true,
],
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer body of commands than a typical key-value system
| such as Memcached. You may define your connection settings here.
|
*/
'redis' => [
'client' => env('REDIS_CLIENT', 'phpredis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug((string) env('APP_NAME', 'laravel')).'-database-'),
'persistent' => env('REDIS_PERSISTENT', false),
],
'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'),
'max_retries' => env('REDIS_MAX_RETRIES', 3),
'backoff_algorithm' => env('REDIS_BACKOFF_ALGORITHM', 'decorrelated_jitter'),
'backoff_base' => env('REDIS_BACKOFF_BASE', 100),
'backoff_cap' => env('REDIS_BACKOFF_CAP', 1000),
],
'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_CACHE_DB', '1'),
'max_retries' => env('REDIS_MAX_RETRIES', 3),
'backoff_algorithm' => env('REDIS_BACKOFF_ALGORITHM', 'decorrelated_jitter'),
'backoff_base' => env('REDIS_BACKOFF_BASE', 100),
'backoff_cap' => env('REDIS_BACKOFF_CAP', 1000),
],
],
];

80
config/filesystems.php Normal file
View File

@ -0,0 +1,80 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application for file storage.
|
*/
'default' => env('FILESYSTEM_DISK', 'local'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Below you may configure as many filesystem disks as necessary, and you
| may even configure multiple disks for the same driver. Examples for
| most supported storage drivers are configured here for reference.
|
| Supported drivers: "local", "ftp", "sftp", "s3"
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app/private'),
'serve' => true,
'throw' => false,
'report' => false,
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => rtrim(env('APP_URL', 'http://localhost'), '/').'/storage',
'visibility' => 'public',
'throw' => false,
'report' => false,
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
'report' => false,
],
],
/*
|--------------------------------------------------------------------------
| Symbolic Links
|--------------------------------------------------------------------------
|
| Here you may configure the symbolic links that will be created when the
| `storage:link` Artisan command is executed. The array keys should be
| the locations of the links and the values should be their targets.
|
*/
'links' => [
public_path('storage') => storage_path('app/public'),
],
];

132
config/logging.php Normal file
View File

@ -0,0 +1,132 @@
<?php
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
use Monolog\Processor\PsrLogMessageProcessor;
return [
/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
| This option defines the default log channel that is utilized to write
| messages to your logs. The value provided here should match one of
| the channels present in the list of "channels" configured below.
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| Deprecations Log Channel
|--------------------------------------------------------------------------
|
| This option controls the log channel that should be used to log warnings
| regarding deprecated PHP and library features. This allows you to get
| your application ready for upcoming major versions of dependencies.
|
*/
'deprecations' => [
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
'trace' => env('LOG_DEPRECATIONS_TRACE', false),
],
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Laravel
| utilizes the Monolog PHP logging library, which includes a variety
| of powerful log handlers and formatters that you're free to use.
|
| Available drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog", "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => explode(',', (string) env('LOG_STACK', 'single')),
'ignore_exceptions' => false,
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'days' => env('LOG_DAILY_DAYS', 14),
'replace_placeholders' => true,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
'emoji' => env('LOG_SLACK_EMOJI', ':boom:'),
'level' => env('LOG_LEVEL', 'critical'),
'replace_placeholders' => true,
],
'papertrail' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
],
'processors' => [PsrLogMessageProcessor::class],
],
'stderr' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class,
'handler_with' => [
'stream' => 'php://stderr',
],
'formatter' => env('LOG_STDERR_FORMATTER'),
'processors' => [PsrLogMessageProcessor::class],
],
'syslog' => [
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER),
'replace_placeholders' => true,
],
'errorlog' => [
'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],
'null' => [
'driver' => 'monolog',
'handler' => NullHandler::class,
],
'emergency' => [
'path' => storage_path('logs/laravel.log'),
],
],
];

118
config/mail.php Normal file
View File

@ -0,0 +1,118 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Mailer
|--------------------------------------------------------------------------
|
| This option controls the default mailer that is used to send all email
| messages unless another mailer is explicitly specified when sending
| the message. All additional mailers can be configured within the
| "mailers" array. Examples of each type of mailer are provided.
|
*/
'default' => env('MAIL_MAILER', 'log'),
/*
|--------------------------------------------------------------------------
| Mailer Configurations
|--------------------------------------------------------------------------
|
| Here you may configure all of the mailers used by your application plus
| their respective settings. Several examples have been configured for
| you and you are free to add your own as your application requires.
|
| Laravel supports a variety of mail "transport" drivers that can be used
| when delivering an email. You may specify which one you're using for
| your mailers below. You may also add additional mailers if needed.
|
| Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
| "postmark", "resend", "log", "array",
| "failover", "roundrobin"
|
*/
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'scheme' => env('MAIL_SCHEME'),
'url' => env('MAIL_URL'),
'host' => env('MAIL_HOST', '127.0.0.1'),
'port' => env('MAIL_PORT', 2525),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url((string) env('APP_URL', 'http://localhost'), PHP_URL_HOST)),
],
'ses' => [
'transport' => 'ses',
],
'postmark' => [
'transport' => 'postmark',
// 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'),
// 'client' => [
// 'timeout' => 5,
// ],
],
'resend' => [
'transport' => 'resend',
],
'sendmail' => [
'transport' => 'sendmail',
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
],
'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL'),
],
'array' => [
'transport' => 'array',
],
'failover' => [
'transport' => 'failover',
'mailers' => [
'smtp',
'log',
],
'retry_after' => 60,
],
'roundrobin' => [
'transport' => 'roundrobin',
'mailers' => [
'ses',
'postmark',
],
'retry_after' => 60,
],
],
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all emails sent by your application to be sent from
| the same address. Here you may specify a name and address that is
| used globally for all emails that are sent by your application.
|
*/
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
];

129
config/queue.php Normal file
View File

@ -0,0 +1,129 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Queue Connection Name
|--------------------------------------------------------------------------
|
| Laravel's queue supports a variety of backends via a single, unified
| API, giving you convenient access to each backend using identical
| syntax for each. The default queue connection is defined below.
|
*/
'default' => env('QUEUE_CONNECTION', 'database'),
/*
|--------------------------------------------------------------------------
| Queue Connections
|--------------------------------------------------------------------------
|
| Here you may configure the connection options for every queue backend
| used by your application. An example configuration is provided for
| each backend supported by Laravel. You're also free to add more.
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis",
| "deferred", "background", "failover", "null"
|
*/
'connections' => [
'sync' => [
'driver' => 'sync',
],
'database' => [
'driver' => 'database',
'connection' => env('DB_QUEUE_CONNECTION'),
'table' => env('DB_QUEUE_TABLE', 'jobs'),
'queue' => env('DB_QUEUE', 'default'),
'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
'after_commit' => false,
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
'queue' => env('BEANSTALKD_QUEUE', 'default'),
'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
'block_for' => 0,
'after_commit' => false,
],
'sqs' => [
'driver' => 'sqs',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'default'),
'suffix' => env('SQS_SUFFIX'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'after_commit' => false,
],
'redis' => [
'driver' => 'redis',
'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
'block_for' => null,
'after_commit' => false,
],
'deferred' => [
'driver' => 'deferred',
],
'background' => [
'driver' => 'background',
],
'failover' => [
'driver' => 'failover',
'connections' => [
'database',
'deferred',
],
],
],
/*
|--------------------------------------------------------------------------
| Job Batching
|--------------------------------------------------------------------------
|
| The following options configure the database and table that store job
| batching information. These options can be updated to any database
| connection and table which has been defined by your application.
|
*/
'batching' => [
'database' => env('DB_CONNECTION', 'sqlite'),
'table' => 'job_batches',
],
/*
|--------------------------------------------------------------------------
| Failed Queue Jobs
|--------------------------------------------------------------------------
|
| These options configure the behavior of failed queue job logging so you
| can control how and where failed jobs are stored. Laravel ships with
| support for storing failed jobs in a simple file or in a database.
|
| Supported drivers: "database-uuids", "dynamodb", "file", "null"
|
*/
'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
'database' => env('DB_CONNECTION', 'sqlite'),
'table' => 'failed_jobs',
],
];

84
config/sanctum.php Normal file
View File

@ -0,0 +1,84 @@
<?php
use Laravel\Sanctum\Sanctum;
return [
/*
|--------------------------------------------------------------------------
| Stateful Domains
|--------------------------------------------------------------------------
|
| Requests from the following domains / hosts will receive stateful API
| authentication cookies. Typically, these should include your local
| and production domains which access your API via a frontend SPA.
|
*/
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
'%s%s',
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
Sanctum::currentApplicationUrlWithPort(),
// Sanctum::currentRequestHost(),
))),
/*
|--------------------------------------------------------------------------
| Sanctum Guards
|--------------------------------------------------------------------------
|
| This array contains the authentication guards that will be checked when
| Sanctum is trying to authenticate a request. If none of these guards
| are able to authenticate the request, Sanctum will use the bearer
| token that's present on an incoming request for authentication.
|
*/
'guard' => ['web'],
/*
|--------------------------------------------------------------------------
| Expiration Minutes
|--------------------------------------------------------------------------
|
| This value controls the number of minutes until an issued token will be
| considered expired. This will override any values set in the token's
| "expires_at" attribute, but first-party sessions are not affected.
|
*/
'expiration' => null,
/*
|--------------------------------------------------------------------------
| Token Prefix
|--------------------------------------------------------------------------
|
| Sanctum can prefix new tokens in order to take advantage of numerous
| security scanning initiatives maintained by open source platforms
| that notify developers if they commit tokens into repositories.
|
| See: https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning
|
*/
'token_prefix' => env('SANCTUM_TOKEN_PREFIX', ''),
/*
|--------------------------------------------------------------------------
| Sanctum Middleware
|--------------------------------------------------------------------------
|
| When authenticating your first-party SPA with Sanctum you may need to
| customize some of the middleware Sanctum uses while processing the
| request. You may change the middleware listed below as required.
|
*/
'middleware' => [
'authenticate_session' => Laravel\Sanctum\Http\Middleware\AuthenticateSession::class,
'encrypt_cookies' => Illuminate\Cookie\Middleware\EncryptCookies::class,
'validate_csrf_token' => Illuminate\Foundation\Http\Middleware\ValidateCsrfToken::class,
],
];

38
config/services.php Normal file
View File

@ -0,0 +1,38 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Mailgun, Postmark, AWS and more. This file provides the de facto
| location for this type of information, allowing packages to have
| a conventional file to locate the various service credentials.
|
*/
'postmark' => [
'key' => env('POSTMARK_API_KEY'),
],
'resend' => [
'key' => env('RESEND_API_KEY'),
],
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'slack' => [
'notifications' => [
'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'),
'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'),
],
],
];

217
config/session.php Normal file
View File

@ -0,0 +1,217 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option determines the default session driver that is utilized for
| incoming requests. Laravel supports a variety of storage options to
| persist session data. Database storage is a great default choice.
|
| Supported: "file", "cookie", "database", "memcached",
| "redis", "dynamodb", "array"
|
*/
'driver' => env('SESSION_DRIVER', 'database'),
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to expire immediately when the browser is closed then you may
| indicate that via the expire_on_close configuration option.
|
*/
'lifetime' => (int) env('SESSION_LIFETIME', 120),
'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false),
/*
|--------------------------------------------------------------------------
| Session Encryption
|--------------------------------------------------------------------------
|
| This option allows you to easily specify that all of your session data
| should be encrypted before it's stored. All encryption is performed
| automatically by Laravel and you may use the session like normal.
|
*/
'encrypt' => env('SESSION_ENCRYPT', false),
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When utilizing the "file" session driver, the session files are placed
| on disk. The default storage location is defined here; however, you
| are free to provide another location where they should be stored.
|
*/
'files' => storage_path('framework/sessions'),
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => env('SESSION_CONNECTION'),
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table to
| be used to store sessions. Of course, a sensible default is defined
| for you; however, you're welcome to change this to another table.
|
*/
'table' => env('SESSION_TABLE', 'sessions'),
/*
|--------------------------------------------------------------------------
| Session Cache Store
|--------------------------------------------------------------------------
|
| When using one of the framework's cache driven session backends, you may
| define the cache store which should be used to store the session data
| between requests. This must match one of your defined cache stores.
|
| Affects: "dynamodb", "memcached", "redis"
|
*/
'store' => env('SESSION_STORE'),
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => [2, 100],
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the session cookie that is created by
| the framework. Typically, you should not need to change this value
| since doing so does not grant a meaningful security improvement.
|
*/
'cookie' => env(
'SESSION_COOKIE',
Str::slug((string) env('APP_NAME', 'laravel')).'-session'
),
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application, but you're free to change this when necessary.
|
*/
'path' => env('SESSION_PATH', '/'),
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| This value determines the domain and subdomains the session cookie is
| available to. By default, the cookie will be available to the root
| domain without subdomains. Typically, this shouldn't be changed.
|
*/
'domain' => env('SESSION_DOMAIN'),
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you when it can't be done securely.
|
*/
'secure' => env('SESSION_SECURE_COOKIE'),
/*
|--------------------------------------------------------------------------
| HTTP Access Only
|--------------------------------------------------------------------------
|
| Setting this value to true will prevent JavaScript from accessing the
| value of the cookie and the cookie will only be accessible through
| the HTTP protocol. It's unlikely you should disable this option.
|
*/
'http_only' => env('SESSION_HTTP_ONLY', true),
/*
|--------------------------------------------------------------------------
| Same-Site Cookies
|--------------------------------------------------------------------------
|
| This option determines how your cookies behave when cross-site requests
| take place, and can be used to mitigate CSRF attacks. By default, we
| will set this value to "lax" to permit secure cross-site requests.
|
| See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value
|
| Supported: "lax", "strict", "none", null
|
*/
'same_site' => env('SESSION_SAME_SITE', 'lax'),
/*
|--------------------------------------------------------------------------
| Partitioned Cookies
|--------------------------------------------------------------------------
|
| Setting this value to true will tie the cookie to the top-level site for
| a cross-site context. Partitioned cookies are accepted by the browser
| when flagged "secure" and the Same-Site attribute is set to "none".
|
*/
'partitioned' => env('SESSION_PARTITIONED_COOKIE', false),
];

1
database/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.sqlite*

View File

@ -0,0 +1,44 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
/**
* @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.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => static::$password ??= Hash::make('password'),
'remember_token' => Str::random(10),
];
}
/**
* Indicate that the model's email address should be unverified.
*/
public function unverified(): static
{
return $this->state(fn (array $attributes) => [
'email_verified_at' => null,
]);
}
}

View File

@ -0,0 +1,49 @@
<?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('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
Schema::create('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->primary();
$table->foreignId('user_id')->nullable()->index();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->longText('payload');
$table->integer('last_activity')->index();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('users');
Schema::dropIfExists('password_reset_tokens');
Schema::dropIfExists('sessions');
}
};

View File

@ -0,0 +1,35 @@
<?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('cache', function (Blueprint $table) {
$table->string('key')->primary();
$table->mediumText('value');
$table->integer('expiration')->index();
});
Schema::create('cache_locks', function (Blueprint $table) {
$table->string('key')->primary();
$table->string('owner');
$table->integer('expiration')->index();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('cache');
Schema::dropIfExists('cache_locks');
}
};

View File

@ -0,0 +1,57 @@
<?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('jobs', function (Blueprint $table) {
$table->id();
$table->string('queue')->index();
$table->longText('payload');
$table->unsignedTinyInteger('attempts');
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
});
Schema::create('job_batches', function (Blueprint $table) {
$table->string('id')->primary();
$table->string('name');
$table->integer('total_jobs');
$table->integer('pending_jobs');
$table->integer('failed_jobs');
$table->longText('failed_job_ids');
$table->mediumText('options')->nullable();
$table->integer('cancelled_at')->nullable();
$table->integer('created_at');
$table->integer('finished_at')->nullable();
});
Schema::create('failed_jobs', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('jobs');
Schema::dropIfExists('job_batches');
Schema::dropIfExists('failed_jobs');
}
};

View File

@ -0,0 +1,33 @@
<?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('personal_access_tokens', function (Blueprint $table) {
$table->id();
$table->morphs('tokenable');
$table->text('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamp('expires_at')->nullable()->index();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('personal_access_tokens');
}
};

View File

@ -0,0 +1,31 @@
<?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('venues', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->enum('type', ['hotel', 'restaurant', 'bar', 'beach', 'pool', 'watersports']);
$table->string('address')->nullable();
$table->enum('group', ['seven', 'city_center', 'coral_bay']);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('venues');
}
};

View File

@ -0,0 +1,27 @@
<?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('campaigns', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('campaigns');
}
};

View File

@ -0,0 +1,25 @@
<?php
namespace Database\Seeders;
use App\Models\User;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
use WithoutModelEvents;
/**
* Seed the application's database.
*/
public function run(): void
{
// User::factory(10)->create();
User::factory()->create([
'name' => 'Test User',
'email' => 'test@example.com',
]);
}
}

17
package.json Normal file
View File

@ -0,0 +1,17 @@
{
"$schema": "https://www.schemastore.org/package.json",
"private": true,
"type": "module",
"scripts": {
"build": "vite build",
"dev": "vite"
},
"devDependencies": {
"@tailwindcss/vite": "^4.0.0",
"axios": "^1.11.0",
"concurrently": "^9.0.1",
"laravel-vite-plugin": "^2.0.0",
"tailwindcss": "^4.0.0",
"vite": "^7.0.7"
}
}

35
phpunit.xml Normal file
View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Unit">
<directory>tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory>tests/Feature</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>app</directory>
</include>
</source>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="BROADCAST_CONNECTION" value="null"/>
<env name="CACHE_STORE" value="array"/>
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>
<env name="MAIL_MAILER" value="array"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="PULSE_ENABLED" value="false"/>
<env name="TELESCOPE_ENABLED" value="false"/>
<env name="NIGHTWATCH_ENABLED" value="false"/>
</php>
</phpunit>

25
public/.htaccess Normal file
View File

@ -0,0 +1,25 @@
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Handle X-XSRF-Token Header
RewriteCond %{HTTP:x-xsrf-token} .
RewriteRule .* - [E=HTTP_X_XSRF_TOKEN:%{HTTP:X-XSRF-Token}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

0
public/favicon.ico Normal file
View File

20
public/index.php Normal file
View File

@ -0,0 +1,20 @@
<?php
use Illuminate\Foundation\Application;
use Illuminate\Http\Request;
define('LARAVEL_START', microtime(true));
// Determine if the application is in maintenance mode...
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
require $maintenance;
}
// Register the Composer autoloader...
require __DIR__.'/../vendor/autoload.php';
// Bootstrap Laravel and handle the request...
/** @var Application $app */
$app = require_once __DIR__.'/../bootstrap/app.php';
$app->handleRequest(Request::capture());

213
public/js/app.js Normal file
View File

@ -0,0 +1,213 @@
// API Client
class ApiClient {
constructor() {
this.baseUrl = '/api';
this.token = localStorage.getItem('token');
}
async request(endpoint, options = {}) {
const url = `${this.baseUrl}${endpoint}`;
const config = {
headers: {
'Content-Type': 'application/json',
...options.headers,
},
...options,
};
if (this.token) {
config.headers.Authorization = `Bearer ${this.token}`;
}
const response = await fetch(url, config);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return response.json();
}
// Auth
async login(credentials) {
const response = await fetch('/api/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(credentials),
});
const data = await response.json();
if (data.token) {
this.token = data.token;
localStorage.setItem('token', data.token);
}
return data;
}
// Guests
async searchGuests(query) {
return this.request(`/guests/search?q=${encodeURIComponent(query)}`);
}
async getGuest(id) {
return this.request(`/guests/${id}`);
}
async createGuest(guestData) {
return this.request('/guests', {
method: 'POST',
body: JSON.stringify(guestData),
});
}
async checkinGuest(id, checkinData) {
return this.request(`/guests/${id}/checkin`, {
method: 'POST',
body: JSON.stringify(checkinData),
});
}
async getCrossSellSuggestions(id) {
return this.request(`/guests/${id}/cross-sell-suggestions`);
}
async addGuestTags(id, tags) {
return this.request(`/guests/${id}/tags`, {
method: 'POST',
body: JSON.stringify({ tags }),
});
}
async addGuestNote(id, note) {
return this.request(`/guests/${id}/notes`, {
method: 'POST',
body: JSON.stringify({ note_text: note }),
});
}
// Loyalty
async getTiers() {
return this.request('/loyalty/tiers');
}
async awardPoints(id, points) {
return this.request(`/guests/${id}/award-points`, {
method: 'POST',
body: JSON.stringify({ points }),
});
}
async getLoyaltyStatus(id) {
return this.request(`/guests/${id}/loyalty-status`);
}
// Vouchers
async getVouchers() {
return this.request('/vouchers');
}
async issueVoucher(guestId, voucherId) {
return this.request(`/guests/${guestId}/issue-voucher/${voucherId}`, {
method: 'POST',
});
}
// Admin
async getKpis() {
return this.request('/dashboard/kpis');
}
async getCharts() {
return this.request('/dashboard/charts');
}
async createCampaign(campaignData) {
return this.request('/campaigns', {
method: 'POST',
body: JSON.stringify(campaignData),
});
}
async getVenues() {
return this.request('/venues');
}
async selectVenue(venueId) {
return this.request(`/venues/${venueId}/select`, {
method: 'POST',
});
}
}
const api = new ApiClient();
// UI Helpers
function showToast(message, type = 'success') {
const toastHtml = `
<div class="toast align-items-center text-white bg-${type} border-0" role="alert">
<div class="d-flex">
<div class="toast-body">${message}</div>
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast"></button>
</div>
</div>
`;
const container = document.createElement('div');
container.innerHTML = toastHtml;
document.body.appendChild(container);
const toastElement = container.firstElementChild;
const toast = new bootstrap.Toast(toastElement);
toast.show();
toastElement.addEventListener('hidden.bs.toast', () => {
document.body.removeChild(container);
});
}
// Initialize on page load
document.addEventListener('DOMContentLoaded', function() {
// Theme toggle
const themeToggle = document.getElementById('theme-toggle');
if (themeToggle) {
themeToggle.addEventListener('click', function() {
document.body.classList.toggle('dark-theme');
localStorage.setItem('theme', document.body.classList.contains('dark-theme') ? 'dark' : 'light');
});
// Load saved theme
if (localStorage.getItem('theme') === 'dark') {
document.body.classList.add('dark-theme');
}
}
// Venue selector
const venueSelect = document.getElementById('venue-select');
if (venueSelect) {
venueSelect.addEventListener('change', async function() {
try {
await api.selectVenue(this.value);
showToast('Venue changed successfully');
} catch (error) {
showToast('Failed to change venue', 'danger');
}
});
}
// Global search
const globalSearch = document.getElementById('global-search');
const globalSearchBtn = document.getElementById('global-search-btn');
if (globalSearch && globalSearchBtn) {
globalSearchBtn.addEventListener('click', function() {
const query = globalSearch.value.trim();
if (query) {
window.location.href = `/guests/search?q=${encodeURIComponent(query)}`;
}
});
globalSearch.addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
globalSearchBtn.click();
}
});
}
});

2
public/robots.txt Normal file
View File

@ -0,0 +1,2 @@
User-agent: *
Disallow:

11
resources/css/app.css Normal file
View File

@ -0,0 +1,11 @@
@import 'tailwindcss';
@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
@source '../../storage/framework/views/*.php';
@source '../**/*.blade.php';
@source '../**/*.js';
@theme {
--font-sans: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
'Segoe UI Symbol', 'Noto Color Emoji';
}

1
resources/js/app.js Normal file
View File

@ -0,0 +1 @@
import './bootstrap';

4
resources/js/bootstrap.js vendored Normal file
View File

@ -0,0 +1,4 @@
import axios from 'axios';
window.axios = axios;
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

View File

@ -0,0 +1,269 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid p-4">
<!-- Header -->
<div class="d-flex justify-content-between align-items-center mb-4">
<div>
<h2 class="mb-0">Admin Dashboard</h2>
<small class="text-muted">Group-wide analytics and management</small>
</div>
<div>
<button class="btn btn-primary me-2">
<i class="fas fa-plus"></i> New Campaign
</button>
<button class="btn btn-outline-secondary">
<i class="fas fa-download"></i> Export Report
</button>
</div>
</div>
<!-- KPI Cards -->
<div class="row mb-4">
<div class="col-md-3">
<div class="card border-0 shadow-sm">
<div class="card-body text-center">
<div class="text-primary mb-2">
<i class="fas fa-users fa-2x"></i>
</div>
<h4 class="mb-0">12,847</h4>
<small class="text-muted">Total Members</small>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card border-0 shadow-sm">
<div class="card-body text-center">
<div class="text-success mb-2">
<i class="fas fa-calendar-check fa-2x"></i>
</div>
<h4 class="mb-0">1,234</h4>
<small class="text-muted">Visits This Month</small>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card border-0 shadow-sm">
<div class="card-body text-center">
<div class="text-warning mb-2">
<i class="fas fa-dollar-sign fa-2x"></i>
</div>
<h4 class="mb-0">AED 2.4M</h4>
<small class="text-muted">Revenue This Month</small>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card border-0 shadow-sm">
<div class="card-body text-center">
<div class="text-info mb-2">
<i class="fas fa-percentage fa-2x"></i>
</div>
<h4 class="mb-0">23.5%</h4>
<small class="text-muted">Cross-sell Success Rate</small>
</div>
</div>
</div>
</div>
<div class="row">
<!-- Revenue Chart -->
<div class="col-md-8">
<div class="card border-0 shadow-sm mb-4">
<div class="card-header bg-light">
<h6 class="mb-0"><i class="fas fa-chart-line"></i> Revenue by Venue (Last 30 Days)</h6>
</div>
<div class="card-body">
<canvas id="revenueChart" height="300"></canvas>
</div>
</div>
</div>
<!-- Tier Distribution -->
<div class="col-md-4">
<div class="card border-0 shadow-sm mb-4">
<div class="card-header bg-light">
<h6 class="mb-0"><i class="fas fa-crown"></i> Member Tier Distribution</h6>
</div>
<div class="card-body">
<canvas id="tierChart" height="300"></canvas>
</div>
</div>
</div>
</div>
<div class="row">
<!-- Active Campaigns -->
<div class="col-md-6">
<div class="card border-0 shadow-sm mb-4">
<div class="card-header bg-light d-flex justify-content-between align-items-center">
<h6 class="mb-0"><i class="fas fa-bullhorn"></i> Active Campaigns</h6>
<button class="btn btn-sm btn-primary">
<i class="fas fa-plus"></i> New
</button>
</div>
<div class="card-body">
<div class="campaign-item mb-3 p-3 border rounded">
<div class="d-flex justify-content-between align-items-start">
<div>
<h6 class="mb-1">City to Coral Bay Cross-sell</h6>
<p class="small text-muted mb-2">Target: City Center Hotel guests Coral Bay packages</p>
<div class="progress mb-2" style="height: 6px;">
<div class="progress-bar bg-success" style="width: 67%"></div>
</div>
<small class="text-muted">67% conversion rate</small>
</div>
<span class="badge bg-success">Active</span>
</div>
</div>
<div class="campaign-item mb-3 p-3 border rounded">
<div class="d-flex justify-content-between align-items-start">
<div>
<h6 class="mb-1">Lebanese Nights Bundle</h6>
<p class="small text-muted mb-2">Target: Rayes & Taiga Sky visitors</p>
<div class="progress mb-2" style="height: 6px;">
<div class="progress-bar bg-primary" style="width: 45%"></div>
</div>
<small class="text-muted">45% conversion rate</small>
</div>
<span class="badge bg-success">Active</span>
</div>
</div>
<div class="campaign-item p-3 border rounded">
<div class="d-flex justify-content-between align-items-start">
<div>
<h6 class="mb-1">Family Pool Package</h6>
<p class="small text-muted mb-2">Target: Hotel guests with children</p>
<div class="progress mb-2" style="height: 6px;">
<div class="progress-bar bg-warning" style="width: 23%"></div>
</div>
<small class="text-muted">23% conversion rate</small>
</div>
<span class="badge bg-warning">Testing</span>
</div>
</div>
</div>
</div>
</div>
<!-- Voucher Management -->
<div class="col-md-6">
<div class="card border-0 shadow-sm mb-4">
<div class="card-header bg-light d-flex justify-content-between align-items-center">
<h6 class="mb-0"><i class="fas fa-gift"></i> Voucher Management</h6>
<button class="btn btn-sm btn-success">
<i class="fas fa-plus"></i> New Voucher
</button>
</div>
<div class="card-body">
<div class="voucher-item mb-3 p-3 border rounded">
<div class="d-flex justify-content-between align-items-start">
<div>
<h6 class="mb-1">Beach Day Pass - 20% Off</h6>
<p class="small text-muted mb-1">Valid at Coral Bay Beach</p>
<small class="text-muted">Expires: Dec 31, 2024</small>
</div>
<div class="text-end">
<span class="badge bg-success mb-1">Active</span>
<br>
<small class="text-muted">142 issued</small>
</div>
</div>
</div>
<div class="voucher-item mb-3 p-3 border rounded">
<div class="d-flex justify-content-between align-items-start">
<div>
<h6 class="mb-1">Dinner for Two - Free Dessert</h6>
<p class="small text-muted mb-1">Valid at La Taverna & Rayes</p>
<small class="text-muted">Expires: Jan 15, 2025</small>
</div>
<div class="text-end">
<span class="badge bg-success mb-1">Active</span>
<br>
<small class="text-muted">89 issued</small>
</div>
</div>
</div>
<div class="voucher-item p-3 border rounded">
<div class="d-flex justify-content-between align-items-start">
<div>
<h6 class="mb-1">Jetski Adventure - 15% Off</h6>
<p class="small text-muted mb-1">Valid at Jetskis</p>
<small class="text-muted">Expires: Feb 28, 2025</small>
</div>
<div class="text-end">
<span class="badge bg-warning mb-1">Limited</span>
<br>
<small class="text-muted">23 issued</small>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@section('scripts')
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
// Revenue Chart
const revenueCtx = document.getElementById('revenueChart').getContext('2d');
new Chart(revenueCtx, {
type: 'bar',
data: {
labels: ['Seven Hotel', 'City Center', 'Coral Bay', 'La Taverna', 'Rayes', 'Taiga Sky', 'Trabouche', 'Beach', 'Pool', 'Jetskis'],
datasets: [{
label: 'Revenue (AED)',
data: [450000, 380000, 520000, 120000, 95000, 78000, 65000, 35000, 28000, 45000],
backgroundColor: 'rgba(13, 110, 253, 0.8)',
borderColor: 'rgba(13, 110, 253, 1)',
borderWidth: 1
}]
},
options: {
responsive: true,
scales: {
y: {
beginAtZero: true,
ticks: {
callback: function(value) {
return 'AED ' + (value / 1000) + 'K';
}
}
}
}
}
});
// Tier Distribution Chart
const tierCtx = document.getElementById('tierChart').getContext('2d');
new Chart(tierCtx, {
type: 'doughnut',
data: {
labels: ['Silver', 'Gold', 'Platinum'],
datasets: [{
data: [6847, 4235, 1765],
backgroundColor: [
'#6c757d',
'#ffd700',
'#6f42c1'
],
borderWidth: 0
}]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'bottom'
}
}
}
});
</script>
@endsection

View File

@ -0,0 +1,272 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hospitality Group CRM - Login</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
<style>
body {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.login-container {
background: white;
border-radius: 15px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
overflow: hidden;
max-width: 900px;
width: 100%;
}
.login-left {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 3rem;
display: flex;
flex-direction: column;
justify-content: center;
}
.login-right {
padding: 3rem;
}
.logo {
font-size: 2.5rem;
font-weight: bold;
margin-bottom: 1rem;
}
.subtitle {
font-size: 1.1rem;
opacity: 0.9;
margin-bottom: 2rem;
}
.venue-card {
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 10px;
padding: 1rem;
margin-bottom: 0.5rem;
cursor: pointer;
transition: all 0.3s ease;
}
.venue-card:hover,
.venue-card.selected {
background: rgba(255, 255, 255, 0.2);
transform: translateY(-2px);
}
.venue-card i {
margin-right: 0.5rem;
}
.form-control:focus {
border-color: #667eea;
box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}
.btn-login {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border: none;
padding: 0.75rem 2rem;
border-radius: 25px;
font-weight: 600;
transition: all 0.3s ease;
}
.btn-login:hover {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}
.demo-credentials {
background: #f8f9fa;
border-radius: 8px;
padding: 1rem;
margin-top: 1rem;
}
.demo-credentials h6 {
color: #495057;
margin-bottom: 0.5rem;
}
.demo-credentials small {
color: #6c757d;
}
</style>
</head>
<body>
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-10">
<div class="login-container">
<div class="row g-0">
<!-- Left Panel -->
<div class="col-lg-5 login-left">
<div>
<div class="logo">
<i class="fas fa-hotel"></i> Hospitality Group
</div>
<div class="subtitle">
CRM & Loyalty Hub
</div>
<p class="mb-4">
Manage guest experiences across Seven Hotel, City Center Hotel, and Coral Bay Resort with our comprehensive loyalty platform.
</p>
<h6 class="mb-3">Select Your Venue</h6>
<div id="venueSelector">
<div class="venue-card selected" data-venue="seven">
<i class="fas fa-hotel"></i> Seven Hotel
</div>
<div class="venue-card" data-venue="city_center">
<i class="fas fa-building"></i> City Center Hotel
</div>
<div class="venue-card" data-venue="coral_bay">
<i class="fas fa-umbrella-beach"></i> Coral Bay Resort
</div>
<div class="venue-card" data-venue="la_taverna">
<i class="fas fa-utensils"></i> La Taverna
</div>
<div class="venue-card" data-venue="rayes">
<i class="fas fa-moon"></i> Rayes
</div>
<div class="venue-card" data-venue="taiga_sky">
<i class="fas fa-glass-martini-alt"></i> Taiga Sky
</div>
<div class="venue-card" data-venue="trabouche">
<i class="fas fa-water"></i> Trabouche
</div>
<div class="venue-card" data-venue="coral_bay_beach">
<i class="fas fa-sun"></i> Coral Bay Beach
</div>
<div class="venue-card" data-venue="coral_bay_pool">
<i class="fas fa-swimming-pool"></i> Coral Bay Pool
</div>
<div class="venue-card" data-venue="jetskis">
<i class="fas fa-ship"></i> Jetskis
</div>
</div>
</div>
</div>
<!-- Right Panel -->
<div class="col-lg-7 login-right">
<h3 class="mb-4">Welcome Back</h3>
<p class="text-muted mb-4">Sign in to access your CRM dashboard</p>
<form id="loginForm">
<div class="mb-3">
<label for="username" class="form-label">Username</label>
<input type="text" class="form-control" id="username" name="username" required>
</div>
<div class="mb-3">
<label for="password" class="form-label">Password</label>
<input type="password" class="form-control" id="password" name="password" required>
</div>
<div class="mb-3 form-check">
<input type="checkbox" class="form-check-input" id="remember">
<label class="form-check-label" for="remember">Remember me</label>
</div>
<button type="submit" class="btn btn-primary btn-login w-100 mb-3" id="loginBtn">
<i class="fas fa-sign-in-alt"></i> Sign In
</button>
</form>
<!-- Demo Credentials -->
<div class="demo-credentials">
<h6><i class="fas fa-info-circle"></i> Demo Credentials</h6>
<div class="row">
<div class="col-6">
<small><strong>Reception:</strong><br>reception / password</small>
</div>
<div class="col-6">
<small><strong>Admin:</strong><br>admin / password</small>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script>
// Venue selection
document.querySelectorAll('.venue-card').forEach(card => {
card.addEventListener('click', function() {
document.querySelectorAll('.venue-card').forEach(c => c.classList.remove('selected'));
this.classList.add('selected');
});
});
// Login form submission
document.getElementById('loginForm').addEventListener('submit', function(e) {
e.preventDefault();
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
const selectedVenue = document.querySelector('.venue-card.selected').dataset.venue;
// Show loading state
const loginBtn = document.getElementById('loginBtn');
const originalText = loginBtn.innerHTML;
loginBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Signing in...';
loginBtn.disabled = true;
// Simulate login (in real app, this would be an API call)
setTimeout(() => {
// Simple demo validation
if ((username === 'reception' && password === 'password') ||
(username === 'admin' && password === 'password')) {
// Store user session (in real app, this would be JWT token)
localStorage.setItem('user', JSON.stringify({
username: username,
role: username === 'admin' ? 'admin' : 'reception',
venue: selectedVenue
}));
// Redirect to dashboard
window.location.href = '/dashboard';
} else {
alert('Invalid credentials. Use demo credentials shown below.');
loginBtn.innerHTML = originalText;
loginBtn.disabled = false;
}
}, 1000);
});
// Auto-fill demo credentials on click
document.querySelectorAll('.demo-credentials small').forEach(el => {
el.style.cursor = 'pointer';
el.addEventListener('click', function() {
const text = this.textContent;
if (text.includes('reception')) {
document.getElementById('username').value = 'reception';
document.getElementById('password').value = 'password';
} else if (text.includes('admin')) {
document.getElementById('username').value = 'admin';
document.getElementById('password').value = 'password';
}
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,293 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid p-4">
<!-- Header -->
<div class="d-flex justify-content-between align-items-center mb-4">
<div>
<h2 class="mb-0">Dashboard</h2>
<small class="text-muted">Welcome back! Here's what's happening today.</small>
</div>
<div class="d-flex gap-2">
<button class="btn btn-outline-primary" onclick="refreshData()">
<i class="fas fa-sync-alt"></i> Refresh
</button>
<div class="dropdown">
<button class="btn btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown">
<i class="fas fa-calendar"></i> Today
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Today</a></li>
<li><a class="dropdown-item" href="#">This Week</a></li>
<li><a class="dropdown-item" href="#">This Month</a></li>
</ul>
</div>
</div>
</div>
<!-- KPI Cards -->
<div class="row mb-4">
<div class="col-md-3">
<div class="card kpi-card border-0 shadow-sm">
<div class="card-body">
<div class="d-flex align-items-center">
<div class="flex-shrink-0">
<div class="bg-primary bg-opacity-10 p-3 rounded">
<i class="fas fa-users fa-2x text-primary"></i>
</div>
</div>
<div class="flex-grow-1 ms-3">
<h3 class="mb-0">247</h3>
<small class="text-muted">Active Members</small>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card kpi-card border-0 shadow-sm">
<div class="card-body">
<div class="d-flex align-items-center">
<div class="flex-shrink-0">
<div class="bg-success bg-opacity-10 p-3 rounded">
<i class="fas fa-sign-in-alt fa-2x text-success"></i>
</div>
</div>
<div class="flex-grow-1 ms-3">
<h3 class="mb-0">42</h3>
<small class="text-muted">Today's Check-ins</small>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card kpi-card border-0 shadow-sm">
<div class="card-body">
<div class="d-flex align-items-center">
<div class="flex-shrink-0">
<div class="bg-warning bg-opacity-10 p-3 rounded">
<i class="fas fa-lightbulb fa-2x text-warning"></i>
</div>
</div>
<div class="flex-grow-1 ms-3">
<h3 class="mb-0">18</h3>
<small class="text-muted">Cross-sell Opportunities</small>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card kpi-card border-0 shadow-sm">
<div class="card-body">
<div class="d-flex align-items-center">
<div class="flex-shrink-0">
<div class="bg-info bg-opacity-10 p-3 rounded">
<i class="fas fa-dollar-sign fa-2x text-info"></i>
</div>
</div>
<div class="flex-grow-1 ms-3">
<h3 class="mb-0">$12,450</h3>
<small class="text-muted">Today's Revenue</small>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Charts Row -->
<div class="row mb-4">
<div class="col-md-6">
<div class="card border-0 shadow-sm">
<div class="card-header bg-white">
<h5 class="mb-0">Visits by Venue</h5>
</div>
<div class="card-body">
<canvas id="venueChart" height="200"></canvas>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card border-0 shadow-sm">
<div class="card-header bg-white">
<h5 class="mb-0">Loyalty Tier Distribution</h5>
</div>
<div class="card-body">
<canvas id="tierChart" height="200"></canvas>
</div>
</div>
</div>
</div>
<!-- Recent Guests Table -->
<div class="card border-0 shadow-sm">
<div class="card-header bg-white d-flex justify-content-between align-items-center">
<h5 class="mb-0">Recent Guests</h5>
<a href="{{ route('guests.search') }}" class="btn btn-primary btn-sm">
<i class="fas fa-search"></i> Search All Guests
</a>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-hover mb-0">
<thead class="table-light">
<tr>
<th>Guest</th>
<th>Loyalty ID</th>
<th>Tier</th>
<th>Last Visit</th>
<th>Venue</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<div class="d-flex align-items-center">
<div class="flex-shrink-0 me-3">
<i class="fas fa-user-circle fa-2x text-secondary"></i>
</div>
<div>
<div class="fw-bold">Sarah Johnson</div>
<small class="text-muted">+971 50 123 4567</small>
</div>
</div>
</td>
<td>
<span class="badge bg-secondary">HG-001234</span>
</td>
<td>
<span class="badge bg-warning text-dark">Gold</span>
</td>
<td>2 hours ago</td>
<td>Seven Hotel</td>
<td>
<a href="{{ route('guests.profile', 1) }}" class="btn btn-sm btn-outline-primary">
<i class="fas fa-eye"></i> View
</a>
</td>
</tr>
<tr>
<td>
<div class="d-flex align-items-center">
<div class="flex-shrink-0 me-3">
<i class="fas fa-user-circle fa-2x text-secondary"></i>
</div>
<div>
<div class="fw-bold">Ahmed Al-Rashid</div>
<small class="text-muted">+971 55 987 6543</small>
</div>
</div>
</td>
<td>
<span class="badge bg-secondary">HG-001235</span>
</td>
<td>
<span class="badge bg-light text-dark border">Silver</span>
</td>
<td>4 hours ago</td>
<td>Rayes</td>
<td>
<a href="{{ route('guests.profile', 2) }}" class="btn btn-sm btn-outline-primary">
<i class="fas fa-eye"></i> View
</a>
</td>
</tr>
<tr>
<td>
<div class="d-flex align-items-center">
<div class="flex-shrink-0 me-3">
<i class="fas fa-user-circle fa-2x text-secondary"></i>
</div>
<div>
<div class="fw-bold">Maria Rodriguez</div>
<small class="text-muted">+971 52 456 7890</small>
</div>
</div>
</td>
<td>
<span class="badge bg-secondary">HG-001236</span>
</td>
<td>
<span class="badge bg-danger">Platinum</span>
</td>
<td>6 hours ago</td>
<td>Coral Bay Beach</td>
<td>
<a href="{{ route('guests.profile', 3) }}" class="btn btn-sm btn-outline-primary">
<i class="fas fa-eye"></i> View
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@section('scripts')
<script>
// Venue Visits Chart
const venueCtx = document.getElementById('venueChart').getContext('2d');
new Chart(venueCtx, {
type: 'doughnut',
data: {
labels: ['Seven Hotel', 'City Center Hotel', 'Coral Bay Resort', 'La Taverna', 'Rayes', 'Taiga Sky'],
datasets: [{
data: [35, 28, 22, 18, 15, 12],
backgroundColor: [
'#007bff',
'#28a745',
'#ffc107',
'#dc3545',
'#6f42c1',
'#20c997'
]
}]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'bottom',
}
}
}
});
// Loyalty Tier Chart
const tierCtx = document.getElementById('tierChart').getContext('2d');
new Chart(tierCtx, {
type: 'bar',
data: {
labels: ['Silver', 'Gold', 'Platinum'],
datasets: [{
label: 'Members',
data: [145, 78, 24],
backgroundColor: [
'#6c757d',
'#ffc107',
'#dc3545'
]
}]
},
options: {
responsive: true,
scales: {
y: {
beginAtZero: true
}
}
}
});
function refreshData() {
showToast('Data refreshed successfully!', 'success');
// In a real app, this would fetch new data from the API
}
</script>
@endsection

View File

@ -0,0 +1,139 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid p-4">
<!-- Header -->
<div class="d-flex justify-content-between align-items-center mb-4">
<div>
<h2 class="mb-0">Quick Guest Registration</h2>
<small class="text-muted">Register new guests in seconds</small>
</div>
<a href="{{ route('guests.search') }}" class="btn btn-outline-secondary">
<i class="fas fa-arrow-left"></i> Back to Search
</a>
</div>
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card border-0 shadow-sm">
<div class="card-body p-4">
<form id="guestForm">
@csrf
<!-- Basic Information -->
<h5 class="mb-3">
<i class="fas fa-user"></i> Guest Information
</h5>
<div class="row mb-3">
<div class="col-md-6">
<label for="name" class="form-label">Full Name <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="name" name="name" required>
</div>
<div class="col-md-6">
<label for="phone" class="form-label">Phone Number <span class="text-danger">*</span></label>
<input type="tel" class="form-control" id="phone" name="phone" placeholder="+971 50 123 4567" required>
</div>
</div>
<div class="row mb-3">
<div class="col-md-6">
<label for="email" class="form-label">Email (Optional)</label>
<input type="email" class="form-control" id="email" name="email">
</div>
<div class="col-md-6">
<label for="nationality" class="form-label">Nationality</label>
<select class="form-select" id="nationality" name="nationality">
<option value="">Select nationality</option>
<option value="UAE">United Arab Emirates</option>
<option value="Saudi Arabia">Saudi Arabia</option>
<option value="UK">United Kingdom</option>
<option value="USA">United States</option>
<option value="Germany">Germany</option>
<option value="France">France</option>
<option value="Other">Other</option>
</select>
</div>
</div>
<!-- Visit Information -->
<h5 class="mb-3 mt-4">
<i class="fas fa-calendar-check"></i> Current Visit
</h5>
<div class="row mb-3">
<div class="col-md-6">
<label for="venue" class="form-label">Venue <span class="text-danger">*</span></label>
<select class="form-select" id="venue" name="venue" required>
<option value="">Select venue</option>
<option value="seven">Seven Hotel</option>
<option value="city_center">City Center Hotel</option>
<option value="coral_bay">Coral Bay Resort</option>
<option value="la_taverna">La Taverna</option>
<option value="rayes">Rayes</option>
<option value="taiga_sky">Taiga Sky</option>
<option value="trabouche">Trabouche</option>
<option value="coral_bay_beach">Coral Bay Beach</option>
<option value="coral_bay_pool">Coral Bay Pool</option>
<option value="jetskis">Jetskis</option>
</select>
</div>
<div class="col-md-6">
<label for="visit_type" class="form-label">Visit Type</label>
<select class="form-select" id="visit_type" name="visit_type">
<option value="stay">Hotel Stay</option>
<option value="dining">Dining</option>
<option value="bar">Bar/Lounge</option>
<option value="beach">Beach Access</option>
<option value="pool">Pool Access</option>
<option value="watersports">Water Sports</option>
</select>
</div>
</div>
<!-- Submit Button -->
<div class="d-grid">
<button type="submit" class="btn btn-primary btn-lg" id="submitBtn">
<i class="fas fa-user-plus"></i> Register Guest & Generate Loyalty Card
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@section('scripts')
<script>
document.getElementById('guestForm').addEventListener('submit', function(e) {
e.preventDefault();
const formData = new FormData(this);
const data = Object.fromEntries(formData);
// Show loading state
const submitBtn = document.getElementById('submitBtn');
const originalText = submitBtn.innerHTML;
submitBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Registering...';
submitBtn.disabled = true;
// Simulate API call
setTimeout(() => {
// Generate loyalty ID
const loyaltyId = 'HG-' + Math.floor(100000 + Math.random() * 900000);
// Reset form and show success
submitBtn.innerHTML = originalText;
submitBtn.disabled = false;
showToast('Guest registered successfully! Loyalty ID: ' + loyaltyId, 'success');
// Redirect to search after a delay
setTimeout(() => {
window.location.href = '{{ route("guests.search") }}';
}, 2000);
}, 1500);
});
</script>
@endsection

View File

@ -0,0 +1,249 @@
@extends('layouts.app')
@section('content')
<div class="row">
<div class="col-12">
<div class="d-flex justify-content-between align-items-center mb-4">
<h2><i class="fas fa-user"></i> Guest Profile</h2>
<div>
<button class="btn btn-success me-2" onclick="issueVoucher()">
<i class="fas fa-ticket-alt"></i> Issue Voucher
</button>
<button class="btn btn-primary" onclick="checkInGuest()">
<i class="fas fa-sign-in-alt"></i> Check In
</button>
</div>
</div>
</div>
</div>
<div class="row">
<!-- Left Panel - Basic Info -->
<div class="col-md-4">
<div class="card mb-4">
<div class="card-header">
<h5>Basic Information</h5>
</div>
<div class="card-body text-center">
<div id="qrCode" class="mb-3"></div>
<h4 id="guestName">John Doe</h4>
<p class="text-muted" id="guestPhone">+961 3 123456</p>
<div class="mb-3">
<span class="badge bg-secondary" id="loyaltyTier">Silver</span>
<small class="text-muted d-block">Loyalty Points: <span id="loyaltyPoints">150</span></small>
</div>
<div class="mb-3">
<strong>Loyalty ID:</strong> <span id="loyaltyId">LOY-001</span>
</div>
<div class="mb-3">
<strong>Nationality:</strong> <span id="nationality">Lebanese</span>
</div>
<div class="mb-3">
<strong>Language:</strong> <span id="language">English</span>
</div>
<div class="mb-3">
<strong>Birthday:</strong> <span id="birthday">1990-01-01</span>
</div>
</div>
</div>
<!-- Quick Actions -->
<div class="card mb-4">
<div class="card-header">
<h5>Quick Actions</h5>
</div>
<div class="card-body">
<button class="btn btn-outline-primary btn-sm w-100 mb-2" onclick="addNote()">
<i class="fas fa-sticky-note"></i> Add Note
</button>
<button class="btn btn-outline-success btn-sm w-100 mb-2" onclick="awardPoints()">
<i class="fas fa-star"></i> Award Points
</button>
<button class="btn btn-outline-info btn-sm w-100 mb-2" onclick="viewHistory()">
<i class="fas fa-history"></i> Full History
</button>
<button class="btn btn-outline-warning btn-sm w-100" onclick="editProfile()">
<i class="fas fa-edit"></i> Edit Profile
</button>
</div>
</div>
</div>
<!-- Center Panel - Timeline -->
<div class="col-md-5">
<div class="card mb-4">
<div class="card-header">
<h5>Visit Timeline</h5>
</div>
<div class="card-body" style="max-height: 600px; overflow-y: auto;">
<div class="timeline" id="visitTimeline">
<!-- Timeline items will be loaded here -->
<div class="timeline-item">
<div class="timeline-marker bg-primary"></div>
<div class="timeline-content">
<h6>Checked into Seven Hotel</h6>
<small class="text-muted">Today, 2:30 PM - Room 301</small>
<p>Spend: $150</p>
</div>
</div>
<div class="timeline-item">
<div class="timeline-marker bg-success"></div>
<div class="timeline-content">
<h6>Dined at La Taverna</h6>
<small class="text-muted">Yesterday, 8:00 PM</small>
<p>Spend: $75 - Italian Cuisine</p>
</div>
</div>
<div class="timeline-item">
<div class="timeline-marker bg-info"></div>
<div class="timeline-content">
<h6>Beach Visit - Coral Bay</h6>
<small class="text-muted">3 days ago, 10:00 AM</small>
<p>Spend: $25 - Day Pass</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Right Panel - Tags & Suggestions -->
<div class="col-md-3">
<!-- Tags -->
<div class="card mb-4">
<div class="card-header">
<h5>Tags</h5>
</div>
<div class="card-body">
<div id="guestTags">
<span class="badge bg-primary me-1 mb-1">beach_lover</span>
<span class="badge bg-success me-1 mb-1">family</span>
<span class="badge bg-warning me-1 mb-1">jetski_fan</span>
</div>
<button class="btn btn-outline-secondary btn-sm w-100 mt-2" onclick="addTag()">
<i class="fas fa-plus"></i> Add Tag
</button>
</div>
</div>
<!-- Cross-sell Suggestions -->
<div class="card mb-4">
<div class="card-header">
<h5>Cross-sell Suggestions</h5>
</div>
<div class="card-body">
<div class="suggestion-item mb-3 p-2 border rounded">
<h6>Coral Bay Beach Package</h6>
<p class="small text-muted">Based on hotel stays, suggest beach access</p>
<button class="btn btn-sm btn-outline-primary">Recommend</button>
</div>
<div class="suggestion-item mb-3 p-2 border rounded">
<h6>Taiga Sky Nightclub</h6>
<p class="small text-muted">Restaurant visitor, suggest nightlife</p>
<button class="btn btn-sm btn-outline-primary">Recommend</button>
</div>
<div class="suggestion-item p-2 border rounded">
<h6>La Taverna Dinner</h6>
<p class="small text-muted">Hotel guest, suggest dining experience</p>
<button class="btn btn-sm btn-outline-primary">Recommend</button>
</div>
</div>
</div>
<!-- Notes -->
<div class="card">
<div class="card-header">
<h5>Recent Notes</h5>
</div>
<div class="card-body" style="max-height: 200px; overflow-y: auto;">
<div class="note-item mb-2">
<small class="text-muted">Today - Reception</small>
<p class="mb-0">Guest requested late checkout for tomorrow.</p>
</div>
<div class="note-item mb-2">
<small class="text-muted">Yesterday - Restaurant</small>
<p class="mb-0">Celebrating anniversary, very satisfied with service.</p>
</div>
</div>
</div>
</div>
</div>
<style>
.timeline {
position: relative;
padding-left: 30px;
}
.timeline-item {
position: relative;
margin-bottom: 20px;
}
.timeline-marker {
position: absolute;
left: -35px;
top: 5px;
width: 12px;
height: 12px;
border-radius: 50%;
}
.timeline::before {
content: '';
position: absolute;
left: -31px;
top: 0;
bottom: 0;
width: 2px;
background: #e9ecef;
}
.timeline-content {
background: #f8f9fa;
padding: 10px;
border-radius: 5px;
}
.suggestion-item {
background: #f8f9fa;
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Generate QR Code
const qrCodeContainer = document.getElementById('qrCode');
const qrCode = new QRCode(qrCodeContainer, {
text: 'LOY-001',
width: 128,
height: 128
});
});
function checkInGuest() {
// Implement check-in functionality
alert('Check-in functionality to be implemented');
}
function issueVoucher() {
// Implement voucher issuance
alert('Voucher issuance to be implemented');
}
function addNote() {
// Implement add note functionality
alert('Add note functionality to be implemented');
}
function awardPoints() {
// Implement award points functionality
alert('Award points functionality to be implemented');
}
function addTag() {
// Implement add tag functionality
alert('Add tag functionality to be implemented');
}
</script>
@endsection

View File

@ -0,0 +1,37 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<div class="row">
<div class="col-md-3">
@include('partials.sidebar')
</div>
<div class="col-md-9">
<h1>Guest Search</h1>
<div class="mb-4">
<input type="text" id="search-input" class="form-control form-control-lg" placeholder="Search by name, phone, or email...">
</div>
<div id="search-results">
<!-- Results will be populated by JS -->
</div>
<!-- Guest 360 Modal -->
<div class="modal fade" id="guestModal" tabindex="-1">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Guest Profile</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body" id="guest-profile">
<!-- Profile content will be loaded here -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,30 @@
<div class="card">
<div class="card-header">
<h5>Hospitality Group CRM</h5>
</div>
<div class="card-body">
<nav class="nav flex-column">
<a class="nav-link" href="{{ route('dashboard') }}">Dashboard</a>
<a class="nav-link" href="{{ route('guests.search') }}">Guest Search</a>
<a class="nav-link" href="{{ route('guests.new') }}">Quick Register</a>
<a class="nav-link" href="{{ route('admin.dashboard') }}">Admin</a>
</nav>
<hr>
<div class="mb-3">
<label for="venue-select" class="form-label">Current Venue</label>
<select class="form-select" id="venue-select">
@foreach($venues as $venue)
<option value="{{ $venue->id }}" {{ $venue->id == session('current_venue_id') ? 'selected' : '' }}>
{{ $venue->name }}
</option>
@endforeach
</select>
</div>
<div class="mb-3">
<button class="btn btn-outline-secondary btn-sm w-100" id="theme-toggle">Toggle Theme</button>
</div>
</div>
</div>

File diff suppressed because one or more lines are too long

8
routes/api.php Normal file
View File

@ -0,0 +1,8 @@
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
Route::get('/user', function (Request $request) {
return $request->user();
})->middleware('auth:sanctum');

8
routes/console.php Normal file
View File

@ -0,0 +1,8 @@
<?php
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote');

19
routes/web.php Normal file
View File

@ -0,0 +1,19 @@
<?php
use App\Http\Controllers\DashboardController;
use App\Http\Controllers\GuestWebController;
use Illuminate\Support\Facades\Route;
// Root URL shows login page
Route::get('/', function () {
return view('auth.login');
});
// CRM Web Routes
Route::get('/dashboard', [DashboardController::class, 'index'])->name('dashboard');
Route::get('/guests/search', [GuestWebController::class, 'search'])->name('guests.search');
Route::get('/guests/new', [GuestWebController::class, 'new'])->name('guests.new');
Route::get('/guests/{id}', [GuestWebController::class, 'profile'])->name('guests.profile');
Route::get('/admin', function () {
return view('admin.dashboard');
})->name('admin.dashboard');

4
storage/app/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
*
!private/
!public/
!.gitignore

2
storage/app/private/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
storage/app/public/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

9
storage/framework/.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
compiled.php
config.php
down
events.scanned.php
maintenance.php
routes.php
routes.scanned.php
schedule-*
services.json

3
storage/framework/cache/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*
!data/
!.gitignore

View File

@ -0,0 +1,2 @@
*
!.gitignore

2
storage/framework/sessions/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
storage/framework/testing/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
storage/framework/views/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
storage/logs/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

View File

@ -0,0 +1,19 @@
<?php
namespace Tests\Feature;
// use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*/
public function test_the_application_returns_a_successful_response(): void
{
$response = $this->get('/');
$response->assertStatus(200);
}
}

10
tests/TestCase.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace Tests;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
//
}

View File

@ -0,0 +1,16 @@
<?php
namespace Tests\Unit;
use PHPUnit\Framework\TestCase;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*/
public function test_that_true_is_true(): void
{
$this->assertTrue(true);
}
}

18
vite.config.js Normal file
View File

@ -0,0 +1,18 @@
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import tailwindcss from '@tailwindcss/vite';
export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js'],
refresh: true,
}),
tailwindcss(),
],
server: {
watch: {
ignored: ['**/storage/framework/views/**'],
},
},
});