Middle
Have you had experience writing PHP code on frameworks or pure PHP?
sobes.tech AI
Answer from AI
Yes, I have experience writing PHP code both in pure PHP and using frameworks.
In pure PHP, I wrote scripts for form processing, interacting with databases via PDO, and implementing simple business logic.
With frameworks, I have worked with Laravel and Symfony, where I used MVC architecture, created routes, controllers, models, and worked with migrations and ORM.
An example of a simple controller in Laravel:
<?php
namespace App\Http\Controllers;
use App\Models\Order;
use Illuminate\Http\Request;
class OrderController extends Controller
{
public function index()
{
$orders = Order::all();
return view('orders.index', compact('orders'));
}
public function store(Request $request)
{
$validated = $request->validate([
'product_id' => 'required|integer',
'quantity' => 'required|integer|min:1',
]);
Order::create($validated);
return redirect()->route('orders.index');
}
}
This experience allows me to develop and maintain backend logic effectively.