Eloquent model representing order line items with price, quantity, and belongsTo relationships to Order and Product.
<?php namespace App\Models; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Support\Carbon; /** * @property int $id * @property float $price * @property int $quantity * @property int $order_id * @property int $product_id * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property-read \App\Models\Order $order * @property-read \App\Models\Product $product * @method static Builder<static>|OrderItem newModelQuery() * @method static Builder<static>|OrderItem newQuery() * @method static Builder<static>|OrderItem query() * @method static Builder<static>|OrderItem whereCreatedAt($value) * @method static Builder<static>|OrderItem whereId($value) * @method ... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key