GitHub Copilot instructions for a Laravel 12 student management system with AdminLTE 3, managing students, courses, venues, and payments with role-based authentication.
Expert instructions for GitHub Copilot when working with a Laravel 12 student management system using AdminLTE 3 dashboard.
This is a Laravel 12 application managing students, courses, venues, academic histories, and payment records with role-based authentication.
**Tech Stack:**
Models use `delete_flag` (boolean, default 0) instead of Eloquent soft deletes. **Always query with:**
```php
Student::where('delete_flag', 0)->find($id)
// NEVER: Student::find($id)
```
When generating queries or controller code, **always include** `where('delete_flag', 0)`.
All admin routes protected by `auth` middleware with `/admin` prefix and `admin.` name prefix:
```php
// routes/web.php pattern:
Route::middleware(['auth'])->prefix('admin')->name('admin.')->group(function () {
Route::get('/dashboard', [DashboardController::class, 'index'])->name('dashboard');
Route::resource('students', StudentController::class);
Route::resource('users', UserController::class);
Route::resource('courses', CourseController::class);
Route::resource('venues', VenueController::class);
Route::resource('academic-history', AcademicHistoryController::class);
Route::resource('payment-history', PaymentHistoryController::class);
Route::resource('system-info', SystemInfoController::class);
// departments disabled
});
```
Controllers in `app/Http/Controllers/Admin/` follow these patterns:
```php
public function index()
{
$students = Student::where('delete_flag', 0)
->paginate(10);
return view('admin.students.index', compact('students'));
}
```
```php
public function store(Request $request)
{
// Validate request
$validated = $request->validate([...]);
Student::create($validated);
return redirect()->route('admin.students.index')
->with('success', 'Student created successfully.');
}
```
```php
public function destroy($id)
{
$student = Student::where('delete_flag', 0)->findOrFail($id);
$student->update(['delete_flag' => 1]);
return redirect()->route('admin.students.index')
->with('success', 'Student deleted successfully.');
}
```
**Never use** `$model->delete()` — always set `delete_flag = 1`.
`app/Providers/AppServiceProvider.php` dynamically configures AdminLTE from database:
```php
public function boot()
{
$systemInfo = SystemInfo::first();
if ($systemInfo) {
config(['adminlte.logo_img' => $systemInfo->logo_img]);
config(['adminlte.title' => $systemInfo->short_name]);
}
view()->share('systemInfo', $systemInfo);
}
```
System branding (logo, name) is **database-driven**, not hardcoded.
When generating views, use these vendor components:
```blade
{{-- Card wrapper --}}
<x-adminlte-card title="Students" theme="primary" icon="fas fa-users">
Content here
</x-adminlte-card>
{{-- Datatable --}}
<x-adminlte-datatable id="students-table" :heads="['ID', 'Name', 'Email', 'Actions']" hoverable bordered>
@foreach($students as $student)
<tr>
<td>{{ $student->id }}</td>
<td>{{ $student->name }}</td>
<td>{{ $student->email }}</td>
<td>...</td>
</tr>
@endforeach
</x-adminlte-datatable>
{{-- Form input --}}
<x-adminlte-input name="name" label="Name" placeholder="Enter name"
fgroup-class="col-md-6" />
{{-- Button --}}
<x-adminlte-button label="Submit" type="submit" theme="success" icon="fas fa-save"/>
```
**Do not create custom CSS** — use AdminLTE's built-in components and themes.
`YYYY_MM_DD_HHMMSS_action_table.php` (e.g., `2025_06_03_155620_create_student_list_table.php`)
Always include:
```php
$table->boolean('delete_flag')->default(0);
```
```php
public function up()
{
Schema::create('student_list', function (Blueprint $table) {
$table->id();
$table->string('first_name');
$table->string('last_name');
$table->string('email')->unique();
$table->boolean('delete_flag')->default(0);
$table->timestamps();
});
}
```
```bash
php artisan migrate # Run pending migrations
php artisan tinker # Interactive shell
npm run dev # Watch Vite builds
composer test # Run PHPUnit
php artisan pint # Format code with Laravel Pint
php artisan storage:link # Link storage for file uploads
```
When asked to create a new CRUD module:
1. **Create Model** in `app/Models/`:
```php
class NewEntity extends Model
{
protected $table = 'new_entities';
protected $fillable = ['name', 'description', 'delete_flag'];
// Relationships
public function relatedModel()
{
return $this->belongsTo(RelatedModel::class);
}
}
```
2. **Create Migration**:
```bash
php artisan make:migration create_new_entities_table
```
Include `delete_flag` and `timestamps()`.
3. **Create Controller** in `app/Http/Controllers/Admin/`:
```php
class NewEntityController extends Controller
{
public function index()
{
$entities = NewEntity::where('delete_flag', 0)->paginate(10);
return view('admin.new-entities.index', compact('entities'));
}
// store, show, edit, update, destroy methods...
}
```
4. **Register Routes** in `routes/web.php`:
```php
Route::resource('new-entities', NewEntityController::class);
```
5. **Create Views** in `resources/views/admin/new-entities/`:
Use AdminLTE components (no custom CSS).
1. **Always exclude soft-deleted records:** `where('delete_flag', 0)`
2. **Pagination:** Use `paginate(10)` for list views
3. **Eager loading:** Prevent N+1 with `with()`: `Student::with(['academicHistories.course'])`
4. **Validation:** Use Form Request classes or inline `$request->validate()`
5. **Flash messages:** `with('success', 'Message')` for user feedback
6. **Named routes:** Always use `route('admin.students.index')` for redirects
---
**When generating code, always:**
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/laravel-adminlte-student-management-system/raw