Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-adminpanel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
laravel-adminpanel
Commits
b5a28bf9
Commit
b5a28bf9
authored
Nov 26, 2017
by
Viral Solani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove City, State and Countries
parent
c8ae33a0
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
0 additions
and
316 deletions
+0
-316
DashboardController.php
app/Http/Controllers/Backend/DashboardController.php
+0
-36
FrontendController.php
app/Http/Controllers/Frontend/FrontendController.php
+0
-38
UserRelationship.php
...dels/Access/User/Traits/Relationship/UserRelationship.php
+0
-33
City.php
app/Models/Cities/City.php
+0
-22
CityRelationship.php
app/Models/Cities/Traits/Relationship/CityRelationship.php
+0
-19
Country.php
app/Models/Countries/Country.php
+0
-20
State.php
app/Models/States/State.php
+0
-22
StateRelationship.php
app/Models/States/Traits/Relationship/StateRelationship.php
+0
-28
2017_11_02_060149_create_cities_table.php
...base/migrations/2017_11_02_060149_create_cities_table.php
+0
-32
2017_11_02_060149_create_countries_table.php
...e/migrations/2017_11_02_060149_create_countries_table.php
+0
-31
2017_11_02_060149_create_states_table.php
...base/migrations/2017_11_02_060149_create_states_table.php
+0
-33
Dashboard.php
routes/Backend/Dashboard.php
+0
-2
No files found.
app/Http/Controllers/Backend/DashboardController.php
View file @
b5a28bf9
...
@@ -6,8 +6,6 @@ use App\Http\Controllers\Controller;
...
@@ -6,8 +6,6 @@ use App\Http\Controllers\Controller;
use
App\Models\Access\Permission\Permission
;
use
App\Models\Access\Permission\Permission
;
use
App\Models\Access\Role\Role
;
use
App\Models\Access\Role\Role
;
use
App\Models\Access\User\User
;
use
App\Models\Access\User\User
;
use
App\Models\Cities\City
;
use
App\Models\States\State
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
/**
/**
...
@@ -23,40 +21,6 @@ class DashboardController extends Controller
...
@@ -23,40 +21,6 @@ class DashboardController extends Controller
return
view
(
'backend.dashboard'
);
return
view
(
'backend.dashboard'
);
}
}
/**
* Used to get the states of default country.
*
* @param Request $request
*
* @return JSON
*/
public
function
getStates
(
Request
$request
)
{
$states
=
State
::
where
(
'country_id'
,
config
(
'access.constants.default_country'
))
->
pluck
(
'state'
,
'id'
)
->
toArray
();
return
[
'status'
=>
'state'
,
'data'
=>
$states
,
];
}
/**
* Used to get the cities of selected state.
*
* @param Request $request
*
* @return JSON
*/
public
function
getCities
(
Request
$request
)
{
$cities
=
City
::
where
(
'state_id'
,
$request
->
stateId
)
->
pluck
(
'city'
,
'id'
)
->
toArray
();
return
[
'status'
=>
'city'
,
'data'
=>
$cities
,
];
}
/**
/**
* Used to display form for edit profile.
* Used to display form for edit profile.
*
*
...
...
app/Http/Controllers/Frontend/FrontendController.php
View file @
b5a28bf9
...
@@ -3,9 +3,7 @@
...
@@ -3,9 +3,7 @@
namespace
App\Http\Controllers\Frontend
;
namespace
App\Http\Controllers\Frontend
;
use
App\Http\Controllers\Controller
;
use
App\Http\Controllers\Controller
;
use
App\Models\Cities\City
;
use
App\Models\Settings\Setting
;
use
App\Models\Settings\Setting
;
use
App\Models\States\State
;
use
App\Repositories\Frontend\CMSPages\CMSPagesRepository
;
use
App\Repositories\Frontend\CMSPages\CMSPagesRepository
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
...
@@ -33,42 +31,6 @@ class FrontendController extends Controller
...
@@ -33,42 +31,6 @@ class FrontendController extends Controller
return
view
(
'frontend.macros'
);
return
view
(
'frontend.macros'
);
}
}
/**
* Used to get the states of default country.
*
* @param Request $request
*
* @return JSON
*/
public
function
getStates
(
Request
$request
)
{
$states
=
State
::
where
(
'country_id'
,
config
(
'access.constants.default_country'
))
->
pluck
(
'state'
,
'id'
)
->
toArray
();
return
[
'status'
=>
'state'
,
'data'
=>
$states
,
];
}
/**
* Used to get the cities of selected state.
*
* @param Request $request
*
* @return JSON
*/
public
function
getCities
(
Request
$request
)
{
$cities
=
City
::
where
(
'state_id'
,
$request
->
stateId
)
->
pluck
(
'city'
,
'id'
)
->
toArray
();
return
[
'status'
=>
'city'
,
'data'
=>
$cities
,
];
}
/**
/**
* show cmspage by pageslug.
* show cmspage by pageslug.
*/
*/
...
...
app/Models/Access/User/Traits/Relationship/UserRelationship.php
View file @
b5a28bf9
...
@@ -3,9 +3,6 @@
...
@@ -3,9 +3,6 @@
namespace
App\Models\Access\User\Traits\Relationship
;
namespace
App\Models\Access\User\Traits\Relationship
;
use
App\Models\Access\User\SocialLogin
;
use
App\Models\Access\User\SocialLogin
;
use
App\Models\Cities\City
;
use
App\Models\Countries\Country
;
use
App\Models\States\State
;
use
App\Models\System\Session
;
use
App\Models\System\Session
;
/**
/**
...
@@ -49,34 +46,4 @@ trait UserRelationship
...
@@ -49,34 +46,4 @@ trait UserRelationship
{
{
return
$this
->
hasMany
(
Session
::
class
);
return
$this
->
hasMany
(
Session
::
class
);
}
}
/**
* Has-One relationship with state.
*
* @return mixed
*/
public
function
state
()
{
return
$this
->
hasOne
(
State
::
class
,
'id'
,
'state_id'
);
}
/**
* Has-One relationship with cty.
*
* @return mixed
*/
public
function
city
()
{
return
$this
->
hasOne
(
City
::
class
,
'id'
,
'city_id'
);
}
/**
* Has-One relationship with country.
*
* @return mixed
*/
public
function
country
()
{
return
$this
->
hasOne
(
Country
::
class
,
'id'
,
'country_id'
);
}
}
}
app/Models/Cities/City.php
deleted
100755 → 0
View file @
c8ae33a0
<?php
namespace
App\Models\Cities
;
use
App\Models\BaseModel
;
use
App\Models\Cities\Traits\Relationship\CityRelationship
;
class
City
extends
BaseModel
{
use
CityRelationship
;
/**
* The database table used by the model.
*
* @var string
*/
protected
$table
;
public
function
__construct
()
{
$this
->
table
=
config
(
'access.cities_table'
);
}
}
app/Models/Cities/Traits/Relationship/CityRelationship.php
deleted
100755 → 0
View file @
c8ae33a0
<?php
namespace
App\Models\Cities\Traits\Relationship
;
use
App\Models\States\State
;
/**
* Class CityRelationship.
*/
trait
CityRelationship
{
/**
* Cities belongs to relationship with state.
*/
public
function
state
()
{
return
$this
->
belongsTo
(
State
::
class
);
}
}
app/Models/Countries/Country.php
deleted
100755 → 0
View file @
c8ae33a0
<?php
namespace
App\Models\Countries
;
use
App\Models\BaseModel
;
class
Country
extends
BaseModel
{
/**
* The database table used by the model.
*
* @var string
*/
protected
$table
;
public
function
__construct
()
{
$this
->
table
=
config
(
'access.countries_table'
);
}
}
app/Models/States/State.php
deleted
100755 → 0
View file @
c8ae33a0
<?php
namespace
App\Models\States
;
use
App\Models\BaseModel
;
use
App\Models\States\Traits\Relationship\StateRelationship
;
class
State
extends
BaseModel
{
use
StateRelationship
;
/**
* The database table used by the model.
*
* @var string
*/
protected
$table
;
public
function
__construct
()
{
$this
->
table
=
config
(
'access.states_table'
);
}
}
app/Models/States/Traits/Relationship/StateRelationship.php
deleted
100755 → 0
View file @
c8ae33a0
<?php
namespace
App\Models\States\Traits\Relationship
;
use
App\Models\Cities\City
;
use
App\Models\Countries\Country
;
/**
* Class StateRelationship.
*/
trait
StateRelationship
{
/**
* States belongs to relationship with country.
*/
public
function
country
()
{
return
$this
->
bolongsTo
(
Country
::
class
);
}
/**
* States has many relationship with cities.
*/
public
function
cities
()
{
return
$this
->
hasMany
(
City
::
class
);
}
}
database/migrations/2017_11_02_060149_create_cities_table.php
deleted
100644 → 0
View file @
c8ae33a0
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
class
CreateCitiesTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'cities'
,
function
(
Blueprint
$table
)
{
$table
->
increments
(
'id'
);
$table
->
integer
(
'state_id'
)
->
unsigned
()
->
index
();
$table
->
string
(
'city'
,
191
);
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
drop
(
'cities'
);
}
}
database/migrations/2017_11_02_060149_create_countries_table.php
deleted
100644 → 0
View file @
c8ae33a0
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
class
CreateCountriesTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'countries'
,
function
(
Blueprint
$table
)
{
$table
->
increments
(
'id'
);
$table
->
string
(
'country'
,
191
);
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
drop
(
'countries'
);
}
}
database/migrations/2017_11_02_060149_create_states_table.php
deleted
100644 → 0
View file @
c8ae33a0
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
class
CreateStatesTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'states'
,
function
(
Blueprint
$table
)
{
$table
->
increments
(
'id'
);
$table
->
integer
(
'country_id'
)
->
unsigned
()
->
index
();
$table
->
string
(
'state'
,
191
);
$table
->
string
(
'state_code'
,
191
);
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
drop
(
'states'
);
}
}
routes/Backend/Dashboard.php
View file @
b5a28bf9
...
@@ -4,8 +4,6 @@
...
@@ -4,8 +4,6 @@
* All route names are prefixed with 'admin.'.
* All route names are prefixed with 'admin.'.
*/
*/
Route
::
get
(
'dashboard'
,
'DashboardController@index'
)
->
name
(
'dashboard'
);
Route
::
get
(
'dashboard'
,
'DashboardController@index'
)
->
name
(
'dashboard'
);
Route
::
post
(
'/get/states'
,
'DashboardController@getStates'
)
->
name
(
'get.states'
);
Route
::
post
(
'/get/cities'
,
'DashboardController@getCities'
)
->
name
(
'get.cities'
);
Route
::
post
(
'get-permission'
,
'DashboardController@getPermissionByRole'
)
->
name
(
'get.permission'
);
Route
::
post
(
'get-permission'
,
'DashboardController@getPermissionByRole'
)
->
name
(
'get.permission'
);
/*
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment