41 lines
1.6 KiB
PHP
Executable File
41 lines
1.6 KiB
PHP
Executable File
<?php
|
|
// Admin-User erstellen
|
|
echo "<h1>👑 Admin-User erstellen</h1>";
|
|
|
|
try {
|
|
// Laravel laden
|
|
require_once 'vendor/autoload.php';
|
|
$app = require_once 'bootstrap/app.php';
|
|
$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
|
|
|
|
// Prüfen ob Admin bereits existiert
|
|
$existingAdmin = \App\Models\User::where('email', 'admin@neonail.com')->first();
|
|
|
|
if ($existingAdmin) {
|
|
echo "<h2>✅ Admin-User existiert bereits!</h2>";
|
|
echo "<p><strong>Name:</strong> {$existingAdmin->name}</p>";
|
|
echo "<p><strong>Email:</strong> {$existingAdmin->email}</p>";
|
|
echo "<p><strong>ID:</strong> {$existingAdmin->id}</p>";
|
|
echo "<p><a href='http://192.168.30.81' style='background: #28a745; color: white; padding: 10px; text-decoration: none; border-radius: 5px;'>🚀 Zur Anwendung</a></p>";
|
|
} else {
|
|
// Admin-User erstellen
|
|
$admin = \App\Models\User::create([
|
|
'name' => 'Admin',
|
|
'email' => 'admin@neonail.com',
|
|
'password' => bcrypt('admin123')
|
|
]);
|
|
|
|
echo "<h2>✅ Admin-User erstellt!</h2>";
|
|
echo "<p><strong>Name:</strong> {$admin->name}</p>";
|
|
echo "<p><strong>Email:</strong> {$admin->email}</p>";
|
|
echo "<p><strong>Passwort:</strong> admin123</p>";
|
|
echo "<p><strong>ID:</strong> {$admin->id}</p>";
|
|
echo "<p><a href='http://192.168.30.81' style='background: #28a745; color: white; padding: 10px; text-decoration: none; border-radius: 5px;'>🚀 Zur Anwendung</a></p>";
|
|
}
|
|
|
|
} catch (Exception $e) {
|
|
echo "<h2>❌ Fehler:</h2>";
|
|
echo "<p>{$e->getMessage()}</p>";
|
|
}
|
|
?>
|