Skip to content

Commit c6d1fb6

Browse files
Commit
Laravel Taxi website
1 parent 4680154 commit c6d1fb6

File tree

1,201 files changed

+200280
-23
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,201 files changed

+200280
-23
lines changed

.env.example

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
APP_NAME=Tranxit
2+
APP_ENV=local
3+
APP_KEY=
4+
APP_DEBUG=true
5+
APP_URL=http://localhost
6+
7+
LOG_CHANNEL=stack
8+
9+
DB_CONNECTION=mysql
10+
DB_HOST=127.0.0.1
11+
DB_PORT=3306
12+
DB_DATABASE=homestead
13+
DB_USERNAME=homestead
14+
DB_PASSWORD=secret
15+
16+
BROADCAST_DRIVER=log
17+
CACHE_DRIVER=file
18+
QUEUE_CONNECTION=sync
19+
SESSION_DRIVER=file
20+
SESSION_LIFETIME=120
21+
22+
REDIS_HOST=127.0.0.1
23+
REDIS_PASSWORD=null
24+
REDIS_PORT=6379
25+
26+
MAIL_DRIVER=smtp
27+
MAIL_HOST=smtp.mailtrap.io
28+
MAIL_PORT=2525
29+
MAIL_USERNAME=null
30+
MAIL_PASSWORD=null
31+
MAIL_ENCRYPTION=null
32+
MAIL_FROM_ADDRESS=null
33+
MAIL_FROM_NAME=null
34+
35+

.gitattributes

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# Auto detect text files and perform LF normalization
21
* text=auto
2+
*.css linguist-vendored
3+
*.scss linguist-vendored

.gitignore

+10-22
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,11 @@
1-
/vendor/
2-
node_modules/
3-
npm-debug.log
4-
yarn-error.log
5-
6-
# Laravel 4 specific
7-
bootstrap/compiled.php
8-
app/storage/
9-
10-
# Laravel 5 & Lumen specific
11-
public/storage
12-
public/hot
13-
14-
# Laravel 5 & Lumen specific with changed public path
15-
public_html/storage
16-
public_html/hot
17-
18-
storage/*.key
19-
.env
20-
Homestead.yaml
1+
/node_modules
2+
/public/storage
3+
/storage/*.key
4+
/vendor
5+
/.idea
216
Homestead.json
22-
/.vagrant
23-
.phpunit.result.cache
7+
Homestead.yaml
8+
.env
9+
/public/uploads/*
10+
/bootstrap/*
11+
/config/constants.php

app/Account.php

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use App\Notifications\AccountResetPassword;
6+
use Illuminate\Notifications\Notifiable;
7+
use Illuminate\Foundation\Auth\User as Authenticatable;
8+
use Spatie\Permission\Traits\HasRoles;
9+
10+
class Account extends Authenticatable
11+
{
12+
use Notifiable;
13+
use HasRoles;
14+
15+
/**
16+
* The attributes that are mass assignable.
17+
*
18+
* @var array
19+
*/
20+
protected $fillable = [
21+
'name', 'email', 'password','mobile'
22+
];
23+
24+
/**
25+
* The attributes that should be hidden for arrays.
26+
*
27+
* @var array
28+
*/
29+
protected $hidden = [
30+
'password', 'remember_token',
31+
];
32+
33+
/**
34+
* Send the password reset notification.
35+
*
36+
* @param string $token
37+
* @return void
38+
*/
39+
public function sendPasswordResetNotification($token)
40+
{
41+
$this->notify(new AccountResetPassword($token));
42+
}
43+
}

app/Admin.php

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use App\Notifications\AdminResetPassword;
6+
use Illuminate\Notifications\Notifiable;
7+
use Illuminate\Foundation\Auth\User as Authenticatable;
8+
use Spatie\Permission\Traits\HasRoles;
9+
use NotificationChannels\WebPush\HasPushSubscriptions;
10+
11+
class Admin extends Authenticatable
12+
{
13+
use Notifiable;
14+
use HasRoles;
15+
use HasPushSubscriptions;
16+
17+
/**
18+
* The attributes that are mass assignable.
19+
*
20+
* @var array
21+
*/
22+
protected $fillable = [
23+
'name', 'email', 'mobile', 'password',
24+
];
25+
26+
/**
27+
* The attributes that should be hidden for arrays.
28+
*
29+
* @var array
30+
*/
31+
protected $hidden = [
32+
'password', 'remember_token',
33+
];
34+
35+
/**
36+
* Send the password reset notification.
37+
*
38+
* @param string $token
39+
* @return void
40+
*/
41+
public function sendPasswordResetNotification($token)
42+
{
43+
$this->notify(new AdminResetPassword($token));
44+
}
45+
}

app/AdminWallet.php

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class AdminWallet extends Model
8+
{
9+
protected $table='admin_wallet';
10+
11+
/**
12+
* The attributes that are mass assignable.
13+
*
14+
* @var array
15+
*/
16+
protected $fillable = [
17+
'transaction_id',
18+
'transaction_alias',
19+
'transaction_desc',
20+
'type',
21+
'amount',
22+
'open_balance',
23+
'close_balance',
24+
];
25+
26+
/**
27+
* The attributes that should be hidden for arrays.
28+
*
29+
* @var array
30+
*/
31+
protected $hidden = [
32+
'updated_at'
33+
];
34+
}

app/Card.php

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class Card extends Model
8+
{
9+
/**
10+
* The attributes that should be hidden for arrays.
11+
*
12+
* @var array
13+
*/
14+
protected $hidden = [
15+
'created_at', 'updated_at'
16+
];
17+
}

app/Chat.php

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class Chat extends Model
8+
{
9+
//
10+
}
+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
<?php
2+
3+
namespace App\Console\Commands;
4+
5+
use Illuminate\Console\Command;
6+
use App\Http\Controllers\SendPushNotification;
7+
use App\Http\Controllers\AdminController;
8+
use App\RequestFilter;
9+
use Carbon\Carbon;
10+
use App\Provider;
11+
use Setting;
12+
use DB;
13+
14+
class CustomCommand extends Command
15+
{
16+
/**
17+
* The name and signature of the console command.
18+
*
19+
* @var string
20+
*/
21+
protected $signature = 'cronjob:rides';
22+
23+
/**
24+
* The console command description.
25+
*
26+
* @var string
27+
*/
28+
protected $description = 'Updating the Scheduled Rides Timing';
29+
30+
/**
31+
* Create a new command instance.
32+
*
33+
* @return void
34+
*/
35+
public function __construct()
36+
{
37+
parent::__construct();
38+
}
39+
40+
/**
41+
* Execute the console command.
42+
*
43+
* @return mixed
44+
*/
45+
public function handle()
46+
{
47+
$UserRequest = DB::table('user_requests')->where('status','SCHEDULED')
48+
->where('schedule_at','<=',\Carbon\Carbon::now()->addMinutes(config('constants.schedule_time', '20')))
49+
->get();
50+
51+
$hour = \Carbon\Carbon::now()->subHour();
52+
$futurehours = \Carbon\Carbon::now()->addMinutes(config('constants.schedule_time', '20'));
53+
$date = \Carbon\Carbon::now();
54+
55+
\Log::info("Schedule Service Request Started.".$date."==".$hour."==".$futurehours);
56+
57+
if(!empty($UserRequest)){
58+
59+
foreach($UserRequest as $ride){
60+
61+
$distance = config('constants.provider_search_radius', '10');
62+
$latitude = $ride->s_latitude;
63+
$longitude = $ride->s_longitude;
64+
$service_type = $ride->service_type_id;
65+
66+
$Providers = Provider::with('service')
67+
->select(DB::Raw("(6371 * acos( cos( radians('$latitude') ) * cos( radians(latitude) ) * cos( radians(longitude) - radians('$longitude') ) + sin( radians('$latitude') ) * sin( radians(latitude) ) ) ) AS distance"),'id')
68+
->where('status', 'approved')
69+
->whereRaw("(6371 * acos( cos( radians('$latitude') ) * cos( radians(latitude) ) * cos( radians(longitude) - radians('$longitude') ) + sin( radians('$latitude') ) * sin( radians(latitude) ) ) ) <= $distance")
70+
->whereHas('service', function($query) use ($service_type) {
71+
$query->where('status','active');
72+
$query->where('service_type_id',$service_type);
73+
})
74+
->orderBy('distance','asc')
75+
->get();
76+
77+
if(config('constants.manual_request',0) == 0){
78+
foreach ($Providers as $key => $Provider) {
79+
80+
if(config('constants.broadcast_request',0) == 1){
81+
(new SendPushNotification)->IncomingRequest($Provider->id);
82+
}
83+
84+
$Filter = new RequestFilter;
85+
// Send push notifications to the first provider
86+
// incoming request push to provider
87+
88+
$Filter->request_id = $ride->id;
89+
$Filter->provider_id = $Provider->id;
90+
$Filter->save();
91+
}
92+
}
93+
94+
DB::table('user_requests')
95+
->where('id',$ride->id)
96+
->update(['status' => 'SEARCHING', 'assigned_at' =>Carbon::now() , 'schedule_at' => null ]);
97+
98+
//scehule start request push to user
99+
(new SendPushNotification)->user_schedule($ride->user_id);
100+
//scehule start request push to provider
101+
//(new SendPushNotification)->provider_schedule($ride->provider_id);
102+
103+
/*DB::table('provider_services')->where('provider_id',$ride->provider_id)->update(['status' =>'riding']);*/
104+
}
105+
}
106+
107+
$CustomPush = DB::table('custom_pushes')
108+
->where('schedule_at','<=',\Carbon\Carbon::now()->addMinutes(5))
109+
->get();
110+
111+
if(!empty($CustomPush)){
112+
foreach($CustomPush as $Push){
113+
DB::table('custom_pushes')
114+
->where('id',$Push->id)
115+
->update(['schedule_at' => null ]);
116+
117+
// sending push
118+
(new AdminController)->SendCustomPush($Push->id);
119+
}
120+
}
121+
122+
}
123+
}

0 commit comments

Comments
 (0)