Giter VIP home page Giter VIP logo

Comments (4)

hmazter avatar hmazter commented on July 16, 2024

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.

Nowi5 avatar Nowi5 commented on July 16, 2024

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.

hmazter avatar hmazter commented on July 16, 2024

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.

hmazter avatar hmazter commented on July 16, 2024

See a quick solution in PR #18

from laravel-schedule-list.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.