Skip to content

Commit fd5bb78

Browse files
committed
UI altered
1 parent 4d2f401 commit fd5bb78

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

database/migrations/2025_02_27_034327_create_students_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function up(): void
2020
$table->string('email')->unique();
2121
$table->string('phone');
2222
$table->string('course');
23-
$table->softDeletes();
23+
$table->softDeletes('deleted_at', precision: 0);
2424

2525
$table->timestamps();
2626
});

resources/views/livewire/students/students.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<div class="overflow-x-auto flex flex-col justify-space relative">
2-
<button class=" absolute top-5 right-5 ">
1+
<div class="overflow-x-auto flex flex-col space-y-4 p-8">
2+
<button class=" flex justify-end ">
33
<a href="{{ route('students.create') }}" class="py-2 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-blue-600 text-white hover:bg-blue-700 focus:outline-none focus:bg-blue-700">
44
Add Student
55
</a>
@@ -16,14 +16,14 @@
1616
</thead>
1717
<tbody class="bg-white divide-y divide-gray-200 dark:bg-gray-900 dark:divide-gray-700">
1818
@foreach($students as $student)
19-
<tr class="hover:bg-gray-50 dark:hover:bg-gray-800 transition-all">
19+
<tr wire.id = "{{$student -> id}}" class="hover:bg-gray-50 dark:hover:bg-gray-800 transition-all">
2020
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-200">{{$student->firstname}}</td>
2121
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-200">{{$student->lastname}}</td>
2222

2323
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-200">{{$student->age}}</td>
2424
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-200">{{$student->address}}</td>
2525
<td class="px-6 py-4 whitespace-nowrap text-end text-sm font-medium">
26-
<button type="button" class="py-2 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-red-600 text-white hover:bg-red-700 focus:outline-none focus:bg-red-700 disabled:opacity-50 disabled:pointer-events-none" wire:click="deleteStudent({{ $student->id }})">
26+
<button type="button" class="py-2 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-red-600 text-white hover:bg-red-700 focus:outline-none focus:bg-red-700 disabled:opacity-50 disabled:pointer-events-none" wire:click="deleteStudent({{ $student->id }})" wire.confirm="Are you sure you want to delete this student?">
2727
Delete
2828
</button>
2929
</td>

0 commit comments

Comments
 (0)