Comments (4)
Hi
Version 1.0.0 will only support Laravel 5.6 (and higher).
I could not get dragonmantank/cron-expression to work with Laravel 5.5 since the cron expression uses 6 positions https://github.com/laravel/framework/blob/5.5/src/Illuminate/Console/Scheduling/Event.php#L30
And that throws an Exception when using dragonmantank/cron-expression, it only supports 5 positions. https://github.com/dragonmantank/cron-expression/blob/master/src/Cron/FieldFactory.php#L46
Here is the PR from dragonmantank himself to make Laravel 5.6 work with version 2 of cron-expression laravel/framework#21637 which means dragonmantank/cron-expression is incompatible with Laravel 5.5.
If you have any other idea, please let me hear or make a PR.
from laravel-schedule-list.
Okay, thank you very much for the prompt answer.
As I was somehow not able to quickly come up with a nice function to show the schedule within a view, I now miss used you command with version 0.2.0.
Quick and dirty, getting the schedule List within a controller index and hand over to view:
public function index()
{
$command = 'schedule:list';
$params = [ ];
\Artisan::call($command, $params);
$artisanOutput = \Artisan::output();
$artisanOutputLines = explode(PHP_EOL,$artisanOutput);
$events = [];
$now = Carbon::now();
for($o = 3; $o < sizeof($artisanOutputLines)-2; $o++){
$parts = explode("|", $artisanOutputLines[$o]);
if(isset($parts[1])){
$event = [];
$event['expression'] = trim($parts[1]);
$event['next_run'] = trim($parts[2]);
$event['command'] = trim($parts[3]);
$event['description'] =trim($parts[4]);
$next_run = new Carbon($event['next_run']);
$event['overdue'] = $now->gt($next_run); //true or false
array_push($events, $event);
}
}
return view('admin.schedule.index', [
'scheduleList' => $events
]);
}
from laravel-schedule-list.
Will see if I can make a fix to truncate the cron expression if its to long (Laravel 5.5 is used) when parsing the next run date.
from laravel-schedule-list.
See a quick solution in PR #18
from laravel-schedule-list.
Related Issues (16)
- Conflict between cron-expression vendors in Laravel 5.6 HOT 1
- Quotes not showing up in schedule:list
- mtdowling/cron-expression deprecated HOT 1
- Question: How long does it take for the update to reach packagist? HOT 2
- InvalidArgumentException : Console command definition is empty. HOT 3
- Breaks laravel 5.5 schedule run HOT 2
- between() and unlessBetween() aren't factored in HOT 5
- Unable to get cron schedule list through controller HOT 4
- Add support for Laravel 6.0 HOT 1
- No description visible HOT 5
- Tests for table style is broken with Laravel 6.15.0 - 6.15.1 HOT 1
- Support timezones HOT 2
- Is this package needed efter the `schedule:list` was introduced in laravel/framework?
- Add "Status" column HOT 3
- Get the result as an array (or object array) HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-schedule-list.