Skip to content

Commit

Permalink
updated scheduler with 15 tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
neshanth committed Sep 21, 2024
1 parent f98421c commit 5dab9f3
Show file tree
Hide file tree
Showing 3 changed files with 160 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:eHnlRHKlGKtKEKT0NRJsr3j/xRzcB3BzumKVYzN8nwM=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=tasklife
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
108 changes: 108 additions & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,114 @@ protected function schedule(Schedule $schedule)
$tasks = DB::table("tasks")->where("user_id","=", $userId)->get();
if(count($tasks) > 0){
DB::table("tasks")->where("user_id","=",$userId)->delete();
$tasks = [
[
'description' => 'Review project plan and finalize the details',
'due_date' => now()->addDays(2)->toDateString(),
'status' => 0,
'task' => 'Project Review',
'user_id' => $userId
],
[
'description' => 'Complete the database migration script',
'due_date' => now()->addDays(4)->toDateString(),
'status' => 0,
'task' => 'Database Migration',
'user_id' => $userId
],
[
'description' => 'Go grocery shopping for the week',
'due_date' => now()->addDays(1)->toDateString(),
'status' => 0,
'task' => 'Grocery Shopping',
'user_id' => $userId
],
[
'description' => 'Prepare presentation for client meeting',
'due_date' => now()->addDays(3)->toDateString(),
'status' => 0,
'task' => 'Client Presentation',
'user_id' => $userId
],
[
'description' => 'Attend yoga class',
'due_date' => now()->addDays(2)->toDateString(),
'status' => 0,
'task' => 'Yoga Session',
'user_id' => $userId
],
[
'description' => 'Respond to pending emails',
'due_date' => now()->addDays(1)->toDateString(),
'status' => 0,
'task' => 'Email Follow-up',
'user_id' => $userId
],
[
'description' => 'Book flight tickets for vacation',
'due_date' => now()->addDays(7)->toDateString(),
'status' => 0,
'task' => 'Book Flight Tickets',
'user_id' => $userId
],
[
'description' => 'Fix bug in user login system',
'due_date' => now()->addDays(2)->toDateString(),
'status' => 0,
'task' => 'Bug Fix: User Login',
'user_id' => $userId
],
[
'description' => 'Schedule team stand-up meeting',
'due_date' => now()->addDays(1)->toDateString(),
'status' => 0,
'task' => 'Team Stand-up',
'user_id' => $userId
],
[
'description' => 'Buy birthday gift for friend',
'due_date' => now()->addDays(5)->toDateString(),
'status' => 0,
'task' => 'Friend\'s Birthday Gift',
'user_id' => $userId
],
[
'description' => 'Plan weekend getaway',
'due_date' => now()->addDays(6)->toDateString(),
'status' => 0,
'task' => 'Weekend Getaway',
'user_id' => $userId
],
[
'description' => 'Design homepage layout',
'due_date' => now()->addDays(3)->toDateString(),
'status' => 0,
'task' => 'Homepage Design',
'user_id' => $userId
],
[
'description' => 'Complete quarterly budget review',
'due_date' => now()->addDays(2)->toDateString(),
'status' => 0,
'task' => 'Budget Review',
'user_id' => $userId
],
[
'description' => 'Call plumber for kitchen sink repair',
'due_date' => now()->addDays(4)->toDateString(),
'status' => 0,
'task' => 'Call Plumber',
'user_id' => $userId
],
[
'description' => 'Watch the new movie release',
'due_date' => now()->addDays(3)->toDateString(),
'status' => 0,
'task' => 'Movie Night',
'user_id' => $userId
]
];
DB::table('tasks')->insert($tasks);
}
})->daily();
}
Expand Down
Empty file added where(user_id
Empty file.

0 comments on commit 5dab9f3

Please sign in to comment.