<?php

namespace App\Http\Controllers;

class ParkingController
{
    public function get()
    {
        return Response::json('success', $this->table()->get());
    }

    public function rentSpace()
    {
        $id = input('id');

        $this->table()->where('id', $id)->update(['rented' => true]);

        return Response::json('success');
    }

    private function table()
    {
        return \Builder::table('parking');
    }
}

<?php

namespace App\Http\Controllers;

class ParkingController
{
    public function get()
    {
        return Response::json('success', $this->table()->get());
    }

    public function rentSpace()
    {
        $id = input('id');

        $this->table()->where('id', $id)->update(['rented' => 'true']);

        return Response::json('success');
    }

    private function table()
    {
        return \Builder::table('parking');
    }
}

Fix saved rented space in db from string 0 to true
Fix saved rented space in db from string 0 to true
