feat: add searches table, model, and factory for API search logging

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ovidiu U
2026-04-04 19:09:19 +01:00
parent 70cb40ff5d
commit c815597a98
3 changed files with 84 additions and 0 deletions

24
app/Models/Search.php Normal file
View File

@@ -0,0 +1,24 @@
<?php
namespace App\Models;
use Database\Factories\SearchFactory;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
#[Fillable(['lat_bucket', 'lng_bucket', 'fuel_type', 'results_count', 'lowest_pence', 'highest_pence', 'avg_pence', 'searched_at', 'ip_hash'])]
class Search extends Model
{
/** @use HasFactory<SearchFactory> */
use HasFactory;
public $timestamps = false;
protected function casts(): array
{
return [
'searched_at' => 'datetime',
];
}
}