<?php

namespace App\Services;

use App\Services\Contracts\ParkServiceInterface;
use App\Models\Park;

class ParkService implements ParkServiceInterface {
    
    public function getParkItem() {
        $parkItem = Park::with('level.area', 'vehicle')
                ->find(session()->get('park.item'));
        
        return $parkItem;
    }

    public function setActive() {
        $parkItem = $this->getParkItem();
        $parkItem->stato = Park::PARK_ACTIVATED;
        $parkItem->save();
    }

}
