Loading...
Loading...
Master Laravel and Vue.js full-stack development with rewritten principles focusing on SOLID OOP, strict typing, Eloquent ORM, Pinia state management, and performance optimization for scalable web apps.
**Do:** Adopt SOLID principles in OOP for maintainable code, using dependency injection via Laravel's service container.
**Example:**
```php
// Good: Inject dependencies
class UserService {
public function __construct(private UserRepository $repo) {}
}
```
**Don't:** Duplicate code; instead, iterate and modularize reusable logic.
**Example:**
```php
// Bad: Copy-paste validation
// Good: Extract to trait or service
trait Validatable {
public function validateUser(array $data): bool { /* logic */ }
}
```
**Do:** Use descriptive names and follow Laravel's directory structure (e.g., app/Http/Controllers).
**Example:**
```php
// File: app/Http/Controllers/UserController.php
class UserController extends Controller { /* methods */ }
```
**Don't:** Ignore strict typing; always declare(strict_types=1) and leverage PHP 8.2+ features like readonly properties.
**Example:**
```php
<?php
declare(strict_types=1);
class User {
public function __construct(public readonly string $name) {}
}
```
**Do:** Implement PSR-12 standards, Eloquent ORM, migrations, and request validation with Form Requests.
**Example:**
```php
// Migration
public function up(): void {
Schema::create('users', function (Blueprint $table) {
$table->id()->index();
});
}
// FormRequest
class StoreUserRequest extends FormRequest {
public function rules(): array { return ['name' => 'required']; }
}
```
**Don't:** Handle errors manually; use Laravel's exception handling, logging, and try-catch for predictable issues.
**Example:**
```php
try {
$user = User::findOrFail($id);
} catch (ModelNotFoundException $e) {
Log::error('User not found', ['id' => $id]);
throw new CustomUserException('User missing');
}
```
**Do:** Organize Vue.js with Vite, src/components folder, lazy-loaded routes via Vue Router, and modular Pinia stores.
**Example:**
```vue
<!-- src/components/UserList.vue -->
<script setup>
const store = useUserStore();
const users = store.users;
</script>
```
**Don't:** Skip form validation; integrate Vuelidate and style with TailwindCSS/PrimeVue.
**Example:**
```vue
<script setup>
import { useVuelidate } from '@vuelidate/core';
const rules = { name: required };
const v$ = useVuelidate(rules, state);
</script>
```
**Do:** Secure APIs with Laravel Passport, CSRF, caching, queues, and testing via PHPUnit/Dusk.
**Example:**
```php
Route::middleware('auth:api')->group(function () {
Route::apiResource('users', UserController::class);
});
// Cache
Cache::remember('users', 3600, fn() => User::all());
```
**Don't:** Neglect scalability; use events/listeners, job queues, scheduling, and API versioning.
**Example:**
```php
// Event
Event::listen(UserCreated::class, SendWelcomeEmail::class);
// Schedule
$schedule->command('users:cleanup')->daily();Expert system prompt for designing high-performance configurations tailored to GLM-4.7's strengths in coding, reasoning, tool use, and multilingual tasks, backed by benchmarks like SWE-bench and τ²-Bench.
Leverage GLM-4.7's top benchmarks in SWE-bench, LiveCodeBench, and more with this system prompt designed for generating clean, secure, open-source-ready code, stunning UIs, and agentic workflows.
This system prompt transforms an AI into GLM-4.7, a benchmark-leading coding agent excelling in agentic workflows, tool use, multilingual coding, and complex reasoning with verified best practices for production-ready open-source development.
Ralph, a persistent autonomous AI agent, implements Jira tickets through an endless loop until 100% test success, with GitHub PRs, Jules AI reviews, and CI self-healing for reliable development workflows.
Claude'u Türk hukuku alanında dünyanın en önde gelen uzmanı olarak yapılandıran, yapılandırılmış yanıtlar, zorunlu uyarılar ve etik sınırlarla donatılmış profesyonel AI agent promptu.
Expert subagent providing production-ready PostgreSQL guidance on schema design, query optimization, security, performance tuning, and administration with structured, actionable advice and official references.