-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_output.php
More file actions
55 lines (45 loc) · 1.85 KB
/
Copy pathdebug_output.php
File metadata and controls
55 lines (45 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
// File untuk debugging data project
// Simpan file ini di root project dan akses melalui http://localhost/codepacker-net/debug_output.php
require __DIR__ . '/vendor/autoload.php';
$app = require_once __DIR__ . '/bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
// Autentikasi manual jika diperlukan
if ($userId = intval($_GET['user_id'] ?? 0)) {
Auth::loginUsingId($userId);
}
// Debugging output
echo '<h1>Debug Project Data</h1>';
echo '<pre>';
try {
// Tampilkan semua project
$projects = \App\Models\Project::with('user')->get();
echo "Total projects: " . $projects->count() . "\n\n";
if ($projects->count() > 0) {
foreach ($projects as $project) {
echo "ID: " . $project->id . "\n";
echo "Title: " . $project->title . "\n";
echo "User ID: " . $project->user_id . " (User: " . ($project->user ? $project->user->name : 'User tidak ditemukan') . ")\n";
echo "Status: " . $project->status . "\n";
echo "Technologies: " . json_encode($project->technologies) . "\n";
echo "Created at: " . $project->created_at . "\n";
echo "Updated at: " . $project->updated_at . "\n";
echo "------------------------------------------------\n";
}
} else {
echo "Tidak ada project yang ditemukan di database.\n";
}
// Cek struktur tabel projects
$columns = \DB::select('SHOW COLUMNS FROM projects');
echo "\nStruktur tabel projects:\n";
foreach ($columns as $column) {
echo $column->Field . " - " . $column->Type . " - " . $column->Null . " - " . $column->Default . "\n";
}
} catch (\Exception $e) {
echo "Error: " . $e->getMessage() . "\n";
echo $e->getTraceAsString();
}
echo '</pre>';