Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
store-locator
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Ajay Barthwal
store-locator
Commits
97e5d098
Commit
97e5d098
authored
Jul 18, 2019
by
Arpit Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Worked on cron controller
parent
b761d9e8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
84 additions
and
20 deletions
+84
-20
.env.example
application/.env.example
+5
-3
CronController.php
application/app/Http/Controllers/CronController.php
+50
-0
SearchController.php
application/app/Http/Controllers/SearchController.php
+1
-1
Apitraits.php
application/app/Traits/Apitraits.php
+21
-2
index.blade.php
application/resources/views/frontend/searchs/index.blade.php
+2
-2
web.php
application/routes/web.php
+5
-12
No files found.
application/.env.example
View file @
97e5d098
...
...
@@ -43,8 +43,9 @@ PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
API_KEY = eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjdlNDUxMWRiZjg2NDgwMDk5MmE3ZjE4MDk2ZDUwOTY1ZjJmMDNmMGVjOGYzYzhjMTQwNGRkOTZmZGUxY2RmNjllZWY3OGE4ZmU3MTIzYTU0In0.eyJhdWQiOiIxIiwianRpIjoiN2U0NTExZGJmODY0ODAwOTkyYTdmMTgwOTZkNTA5NjVmMmYwM2YwZWM4ZjNjOGMxNDA0ZGQ5NmZkZTFjZGY2OWVlZjc4YThmZTcxMjNhNTQiLCJpYXQiOjE1NjIxNDYyOTUsIm5iZiI6MTU2MjE0NjI5NSwiZXhwIjoxNTYzNDQyMjk1LCJzdWIiOiIiLCJzY29wZXMiOlsicmVhZC1sb2NhdGlvbiJdfQ.RcGybPTQUPHMAA5y7nclG01hgaa7e8imF6x0q0SR9PqIMFQ9yVjXJCu4Hx4i3-AwVv27FE6RQ84-EpzPO1XmCHpuqLg6F4OWyn8Xv6pceLSxAzSKvrsYeS2W1uqCxFxeBaQmx4Uq5xdf0wQ9Ao-3914XrFTnWMYh1Rd94o4mPmlyeBB8H2e1nIM4Vtuh98-oDMxclhh_1A1XXUOe7L4TILqBMjyQlaRIDBTnVdA_fNYK7ZPWDy6j-t_yQpf4NOXWXGbldpZ0KAu2Fb1llsnizE0Ryd310z1zUZPtgbqdkC7mCBpXQf9wmE3GUihLj84Vyh7Q-dnKZw0HlZDdRWasFxTpss0wcEDDcLM1u7Sgl2wT83Sq7h61hfShhM18fqHwQL5TKKDyQ3pv6z4-AVhcwV5IOPMJPyZLfrydezTEn6cNf8q-gAvTMFqayQEoKLtMlXWQ1Oy81UQIo9_3LTGaKrS2qz8lNNY132qFaXb6NwRsv73MWb1DkZdEBj9CoV5UncYeCVDHephaAQxKZva5HGoi1-Gvd2ltY_S64zuOZORpcyCMHwyTHKOc8w7dGrJpT1uXHDtF73KB5XXNFRu66HWS0V1WniBtxYzB8cG_eDlU_Ak9QnywlXTcIkq10pbnad7hnsRdmSDL3ksA7yVLMAZ9MAyR-T7giAw_BTslM5I
API_LIST = https://anitadongre.concr.in/api/v1/locations/list?keyword=
API_LIST = https://anitadongre.concr.in/api/v1/locations/list
API_LOCATION = https://anitadongre.concr.in/api/v1/locations/
API_SEARCH = https://anitadongre.concr.in/api/v1/locations/search?keyword=
API_REVIEW = https://anitadongre.concr.in/api/v1/locations/204/reviews
API = https://anitadongre.concr.in/api/v1/locations/
API_KEY_URL = https://anitadongre.concr.in/api/v1/generate/client/token
\ No newline at end of file
application/app/Http/Controllers/CronController.php
0 → 100644
View file @
97e5d098
<?php
namespace
App\Http\Controllers
;
use
Illuminate\Http\Request
;
use
DB
;
use
Validator
;
use
App\Traits\Apitraits
;
use
App\Locater
;
use
Illuminate\Support\Facades\Hash
;
class
CronController
extends
Controller
{
use
Apitraits
;
public
function
getLocaterListData
(
Request
$request
){
$api_url
=
config
(
'app.api_list'
);
$getLocaterListMetaData
=
$this
->
cronList
(
$api_url
);
for
(
$i
=
$getLocaterListMetaData
[
'current_page'
];
$i
<=
$getLocaterListMetaData
[
'last_page'
];
$i
++
){
$getLocaterListDataNew
=
$this
->
call_api_page
(
$api_url
,
''
,
$i
);
$finalData
=
array_map
(
function
(
$data
)
use
(
$getLocaterListDataNew
)
{
$checkLocaterData
=
Locater
::
find
(
$data
[
'id'
]);
if
(
empty
(
$checkLocaterData
)){
$locater
=
new
Locater
;
$locater
->
locater_identity
=
$data
[
'id'
];
$locater
->
locater_code
=
$data
[
'code'
];
$locater
->
name
=
$data
[
'name'
];
$locater
->
created_by
=
1
;
$locater
->
save
();
}
},
$getLocaterListDataNew
[
'data'
]);
}
return
response
()
->
json
([
'status'
=>
'success'
,
'data'
=>
'Updated Sucessfully'
]);
}
}
\ No newline at end of file
application/app/Http/Controllers/SearchController.php
View file @
97e5d098
...
...
@@ -97,7 +97,7 @@ class SearchController extends Controller
/**
* For render location list after searching
* */
public
function
searchlocat
o
r
(
Request
$request
)
public
function
searchlocat
e
r
(
Request
$request
)
{
$detail
=
$this
->
getApiData
(
$request
[
'locality'
],
$request
[
'page'
]);
...
...
application/app/Traits/Apitraits.php
View file @
97e5d098
...
...
@@ -110,14 +110,14 @@ Trait Apitraits
'keyword'
=>
$locatorID
,
'page'
=>
empty
(
$page
)
?
1
:
$page
);
$client
=
new
Client
();
$response
=
$client
->
request
(
'GET'
,
$api_url
,
[
'headers'
=>
[
'Accept'
=>
'application/json'
,
'Authorization'
=>
$apiKey
],
'query'
=>
$query_param
]);
$statusCode
=
$response
->
getStatusCode
();
$body
=
$response
->
getBody
()
->
getContents
();
return
$locationDetailAPIdata
=
json_decode
(
$body
,
true
);
...
...
@@ -146,4 +146,22 @@ Trait Apitraits
return
$locationDetailAPIdata
=
json_decode
(
$body
,
true
);
}
public
function
cronList
(
$api_url
)
{
$apiKey
=
$this
->
getAPiKey
();
$client
=
new
Client
();
$response
=
$client
->
request
(
'GET'
,
$api_url
,
[
'headers'
=>
[
'Accept'
=>
'application/json'
,
'Authorization'
=>
$apiKey
],
]);
$statusCode
=
$response
->
getStatusCode
();
$body
=
$response
->
getBody
()
->
getContents
();
$locationDetailAPIdata
=
json_decode
(
$body
,
true
);
return
$locationDetailAPIdata
[
'meta'
];
}
}
\ No newline at end of file
application/resources/views/frontend/searchs/index.blade.php
View file @
97e5d098
...
...
@@ -145,7 +145,7 @@
e.preventDefault();
$.ajax({
type: 'post',
url: "
{{
route
(
'searchlocat
o
r'
)}}
",
url: "
{{
route
(
'searchlocat
e
r'
)}}
",
data: $('form').serialize(),
success: function (datanew) {
/*$( "
#searchlocaterid" ).html( datanew );*/
...
...
@@ -170,7 +170,7 @@
function
paginate
(
page
,
locality
){
$
.
ajax
({
type
:
'post'
,
url
:
"
{
{route('searchlocat
o
r')}
}
"
,
url
:
"
{
{route('searchlocat
e
r')}
}
"
,
data
:
{
"_token"
:
"{{ csrf_token() }}"
,
page
:
page
,
locality
:
locality
},
success
:
function
(
datanew
)
{
if
(
datanew
.
status
==
'success'
)
{
...
...
application/routes/web.php
View file @
97e5d098
...
...
@@ -16,19 +16,19 @@
});*/
Route
::
get
(
'/'
,
'SearchController@index'
)
->
name
(
'search'
);
Route
::
post
(
'searchlocat
or'
,
'SearchController@searchlocator'
)
->
name
(
'searchlocato
r'
);
Route
::
post
(
'searchlocat
er'
,
'SearchController@searchlocater'
)
->
name
(
'searchlocate
r'
);
Route
::
get
(
'autocomplete'
,
'SearchController@autocomplete'
)
->
name
(
'autocomplete'
);
Route
::
get
(
'detail/{slug}'
,
'SearchController@detail'
)
->
name
(
'detail'
);
Route
::
post
(
'reviewpaginate'
,
'SearchController@reviewpaginate'
)
->
name
(
'reviewpaginate'
);
/* Cron Routes */
Route
::
get
(
'cron/getLocaterListData'
,
'CronController@getLocaterListData'
)
->
name
(
'getLocaterListData'
);
/** End Cron Routes */
Auth
::
routes
();
Route
::
get
(
'/home'
,
'HomeController@index'
)
->
name
(
'home'
);
//Auth::routes();
//Route::get('/home', 'HomeController@index')->name('home');
Route
::
get
(
'/check_email'
,
'HomeController@check_email'
)
->
name
(
'check_email'
);
Route
::
get
(
'/check_locater_identity'
,
'HomeController@check_locater_identity'
)
->
name
(
'check_locater_identity'
);
...
...
@@ -44,7 +44,6 @@ Route::group(['middleware' => ['auth'], 'prefix' => 'admin', 'namespace' => 'Adm
Route
::
post
(
'users/{id}/edit'
,
'UserController@updateUser'
)
->
name
(
'admin.user.update'
);
Route
::
get
(
'users/{id}/delete'
,
'UserController@deleteUser'
)
->
name
(
'admin.user.delete'
);
/* For manage locaters */
Route
::
get
(
'locaters'
,
'LocaterController@locatersList'
)
->
name
(
'admin.locaters'
);
Route
::
get
(
'locaters/create'
,
'LocaterController@createLocater'
)
->
name
(
'admin.locaters.add'
);
...
...
@@ -53,12 +52,6 @@ Route::group(['middleware' => ['auth'], 'prefix' => 'admin', 'namespace' => 'Adm
Route
::
post
(
'locaters/{id}/edit'
,
'LocaterController@updateLocater'
)
->
name
(
'admin.locaters.update'
);
Route
::
get
(
'locaters/{id}/delete'
,
'LocaterController@deleteLocater'
)
->
name
(
'admin.locaters.delete'
);
/*Route::get('locaters/create', 'LocaterController@createLocater')->name('admin.locaters.add');
Route::post('locaters/create', 'LocaterController@saveLocater')->name('admin.locaters.save');
Route::get('locaters/{id}/edit', 'LocaterController@editLocater')->name('admin.locaters.edit');
Route::post('locaters/{id}/edit', 'LocaterController@updateLocater')->name('admin.locaters.update');
Route::post('locaters/{id}/delete', 'LocaterController@deleteLocater')->name('admin.locaters.delete');*/
/* For manage pages */
Route
::
any
(
'pages'
,
'PageController@pagesList'
)
->
name
(
'admin.pages'
);
Route
::
get
(
'pages/create'
,
'PageController@createPage'
)
->
name
(
'admin.pages.add'
);
...
...
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