add lots
This commit is contained in:
28
app/Http/Controllers/HomeController.php
Normal file
28
app/Http/Controllers/HomeController.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
*
|
||||
* @return \Illuminate\Contracts\Support\Renderable
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('home');
|
||||
}
|
||||
}
|
||||
19
app/ParkingLot.php
Normal file
19
app/ParkingLot.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ParkingLot extends Model
|
||||
{
|
||||
protected $fillable = [ 'firebase_id', 'stall_coordinates', 'reference_image' ];
|
||||
|
||||
public function get_coordinates(){
|
||||
return json_decode( $this->stall_coordinates );
|
||||
}
|
||||
|
||||
public function set_coordinates( $coordinates ){
|
||||
$this->stall_coordinates = json_encode( $coordinates );
|
||||
$this->save();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user