Skip to content

Commit 2105e59

Browse files
committed
app: added model for LocationSearchOption and made use of it in HomeController
1 parent af13d3c commit 2105e59

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

app/app/Http/Controllers/HomeController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use App\LocationTag;
44
use App\BaseUser;
5+
use App\LocationSearchOption;
56
use DB;
67
use Illuminate\Routing\Controller;
78
use Illuminate\Http\Request;
@@ -21,7 +22,7 @@ public function index(Request $request)
2122
if (trim($address_value) === trim(BaseUser::getDefaultAddress())) {
2223
$address_value = '';
2324
}
24-
$location_search_options = DB::table('location_search_option')->get();
25+
$location_search_options = LocationSearchOption::query()->get();
2526
if (Input::has('keywords')) {
2627
$keywords = trim(Input::get('keywords'));
2728
BaseUser::setKeywords($keywords);

app/app/LocationSearchOption.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class LocationSearchOption extends Model
8+
{
9+
protected $fillable = [
10+
'content'
11+
];
12+
13+
protected $table = 'location_search_option';
14+
}

0 commit comments

Comments
 (0)