Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Pineco.de:
Scheduling MySQL Backups with Laravel
May 28, 2018 @ 13:19:16

On Pineco.de they've posted a new tutorial showing you how to create a MySQL database backup system using Laravel and a command-line call to mysqldump wrapped in an Artisan command.

A few days ago, I signed in to the wrong database and deleted around 18 000 records that were in use. Not to mention, we had no backup for that data. So after all, I decided to make a little script to dump the database and save it to an SQL file automatically.

But, if you are here for a fully working backup system, you should take a look at <a href="https://github.com/spatie/laravel-backup>this package. We won’t cover more just scheduling database exports and its scheduling.

The post starts with the command that will be executed on the command-line and the code required to "warm up" the console and run the command. He shares the code for this command and walks through it, explaining each part. Next comes the scheduling of the task and, as a bonus, setting up the scheduler to run on the Forge service.

tagged: schedule mysql backup laravel mysqldump tutorial

Link: https://pineco.de/scheduling-mysql-backups-with-laravel/

Laravel News:
User Defined Schedules in Laravel
Mar 09, 2018 @ 11:43:31

On the Laravel News site there's a new post looking at the use of user-defined schedules and some of the "hidden" features the Laravel framework provides to allow for even more customization.

Recently Adam Wathan and Taylor Otwell have used Basecamp to track what they are doing every day–a tech diary. Notably, they are using the check-in feature which allows you to schedule questions to be sent to members about almost anything. Taylor and Adam are using it for “What did you work on today?”

It’s not that it’s the same time of day or even that it’s only weekdays which peaked my curiosity but the fact every check-in has a custom schedule defined by a user. In Laravel, we can quickly schedule a job to run every weekday at 4 pm, and we can use a custom timezone. But out of the box, we cannot set a different schedule for every individual check-in. We would have to store a cron expression and manually check every minute if it’s due.

After some "source code diving" the author figured out that the Schedulable trait allows you to define a more customized version of a schedule to fit your needs, making it simple to implement in any class or model. Code examples of these changes are included in the post as well as some next steps to have it implemented more widely either in the Laravel core or a package.

tagged: laravel schedule custom trait tutorial example

Link: https://laravel-news.com/user-defined-schedules-in-laravel

Community News:
php[tek] 2018 Schedule Posted
Jan 23, 2018 @ 09:49:18

The php[tek] conference, from the folks behind php[architect] magazine, has officially posted the schedule for their 2018 event happening in late May.

Sessions at this year's event include:

  • "Evolution of PHP Security" by Eric Mann
  • "Mastering REST API Tests with Codeception" by Michael Bodnarchuk
  • "PHP on Kubernetes" by Chris Church
  • "Building Facal Recognition Services with Javascript and AWS" by Kesha Williams
  • "Greener Pastures: Infrastructure from the Group Up" by Steve Grunwell
  • "As Easy as Falling Off a Log (or Writing One)" by Brent Laminack

There's tons more this year's conference has to offer, so be sure to check out this full schedule and find those topics that interest you. You can still pick up Early Bird tickets (for just the conference or the conference+training) until the end of February so be sure to get yours while you can!

tagged: phptek tek18 conference schedule posted 2018

Link: https://tek.phparch.com/schedule

TutsPlus.com:
Task Scheduling in Laravel
Dec 04, 2017 @ 10:51:52

On the TutsPlus.com site there's a new tutorial posted introducing you to task scheduling in Laravel, a feature that allows you to run code in the application periodically similar to a cron job.

In this article, we’ll go through one of the exciting features of the Laravel web framework—task scheduling. Throughout the course of this article, we’ll look at how Laravel allows you to manage scheduled tasks in your application. Moreover, we’ll also end up creating our own custom scheduled tasks for demonstration purposes.

The Laravel framework allows you to set up scheduled tasks so that you don't have to worry about setting them up at the system level. You can get rid of that complex cron syntax while setting up scheduled tasks since Laravel allows you to define them in a user-friendly way.

The article starts with a brief introduction to cron jobs, how they're set up and some issues that come along with them. Next the article describes the "Laravel Way" of handling task scheduling, showing how to use Laravel's artisan command to run the scheduler. With the basics laid out, the author then walks through how to create a custom task either using a closure/callable, making an artisan command or using the exec command. Code examples are included for each and more information about scheduling options and functionality can be found in the Laravel manual.

tagged: task schedule tutorial laravel artisan closure exec command

Link: https://code.tutsplus.com/tutorials/tasks-scheduling-in-laravel--cms-29815

Unnikked.ga:
How To Schedule User Generated Cron Jobs In Laravel
Oct 10, 2017 @ 09:55:05

On the Unnikked.ga site there's a tutorial posted by Nicola Malizia showing you how to schedule user-generated cron jobs in Laravel using the built-in job handling functionality.

While developing a personal project I was in the need to let user defines actions that run periodically.

My first thought was to use the Task Scheduling component of Laravel. The solution that I came up with is quite simple, yet effective.

He then walks through the process of setting up a "tasks" table where users can define their jobs and how to pull and execute them as a part of the Kernel.php configuration. He ends the post asking readers if there's another way they might go about this and still allow users to define their own jobs without having to write the code for each type.

tagged: laravel schedule user job tutorial task kernel

Link: https://unnikked.ga/how-to-schedule-user-generated-cron-jobs-in-laravel-8a1e0400bb10

TutsPlus.com:
Building Your Startup: Using Routes for Schedule With Me
May 01, 2017 @ 12:15:16

On the TutsPlus.com site they've posted the latest tutorial of their "Building Your Startup" series. In this latest article author Jeff Reifman focuses on adding routes and handling for the "schedule with me" functionality.

For a long time since I began this project, I've wanted Meeting Planner and Simple Planner to have a publicly accessible page you can share with people to schedule a meeting with you. In other words, "Sure, let's meet, just visit my schedule with me page at Meeting Planner, I'm Bernie Sanders (no space)."

In today's tutorial, I'll show you I've done it using Yii's routing and some of the related issues that came up.

He starts with a screencast of the feature (the end result) showing how the UI functions and what features it includes. He then takes a step back and starts on the development process beginning with the planning quickly followed by the code. He shows the creation of the initial view, making the routing changes and how to handle signup and login for the "Schedule With Me" page.

tagged: build startup series meetingplanner meeting schedule tutorial

Link: https://code.tutsplus.com/tutorials/building-your-startup-using-routes-for-schedule-with-me--cms-27796

php[architect]:
Conference Schedule Released for php[tek] 2017
Jan 16, 2017 @ 11:10:56

The php[architect] site has released the official announcement of the php[tek] 2017 conference schedule being released:

Our conference chairs announced the lineup of speakers and talks for php[tek] 2017. It’s a great lineup, and you don’t have to just take our word for it. It’s shaping up to be a conference you don’t want to miss which takes place over 5 days May in Atlanta. Head over to the php[tek] site to see the schedule and register.

They've also included a list of just a few of the talks that will be presented at this year's event including:

  • Demystifying Object-Oriented Programming with Alena Holligan
  • *MySQL-Awesome Features You’re Probably Missing8 with Liam Wiltshire
  • Learning About Machine Learning with Joel Lord

You can view the full schedule for the conference, happening May 24th through 28th in Atlanta, Georgia, on the main conference site and pick up your tickets too.

tagged: atlanta talks release schedule conference phptek17 georgia may

Link: https://www.phparch.com/2017/01/phptek-conference-schedule-released/

Zend Developer Zone:
Scheduling ElePHPants (DateTime math is HARD)
Nov 18, 2016 @ 12:49:38

On the Zend Developer Zone there's a new post talking about scheduling in applications ("scheduling elePHPants") including both library recommendations and advice about code reuse.

It was while I was creating the 100th or so cronjob to do some very similar to the other 99 that I thought, “Hey! Why not just put all this in a database and check it once a minute instead?” [...] It would be so much easier to deal with in PHP. Also, cron does not scale well at all either in performance or management.

The problem is that cron is an elegant solution for “Do this at that time” type of problems. Every solution I came up with was basically re-creating cron. That in itself isn’t a bad thing, but the logic involved in doing what cron does is mind-melting.

[...] Then it hit me, I am probably not the first person that has had this need. There have probably been other people who needed to implement “Do this at that time” within a PHP application. So I started looking around. What I found was encouraging.

The author then mentions several packages that he went through searching for the right solution to his problem, noting that while Laravel-based solutions seemed nice, they wouldn't work with his framework choice (Slim). He decided on the cron-expression package, finding it to be the best fit for the project's needs.

I had spent countless hours trying to create the solution myself. [...] I got so lost in solving the problem, I forgot to look to see if someone had already solved it. [...] After I finally came to my senses, I tweeted that out to remind myself to “Use the Source”.
tagged: schedule task cron experience package code reuse datetime

Link: https://devzone.zend.com/7418/scheduling-elephpants-datetime-math-is-hard/

Laravel News:
Laracon US Schedule Announced
Mar 18, 2016 @ 12:31:11

The Laravel News site has a new post today sharing the full schedule announcement for this year's Laracon conference (happing in Louisville, Kentucky July 27th through the 29th).

Laracon just announced the preliminary schedule for this year’s conference. Just as in the past, it leaves ample time for hanging out and meeting others interested in the framework.

Sessions for this year's conference include:

  • "Test Driven Laravel" (Adam Wathan)
  • "Servers For Hackers" (Chris Fidao)
  • "PHP 7" (Zeev Suraski)
  • "Tests Should Tell A Story" (Matthew Machuga)
  • "YAGNI With Laravel" (Jason McCreary)
  • "Lumen, Guzzle, & Swagger" (Jeremy Lindblom)

You can find more information about the conference and pick up tickets from the main conference website. There are discounts available for groups of 3 or more too.

tagged: laravel schedule announced laraconus lousiville kentucky july

Link: https://laravel-news.com/2016/03/laracon-us-schedule-announced/

Community News:
Lone Star PHP 2016 Schedule Announced
Jan 27, 2016 @ 13:40:58

The Lone Star PHP Conference, happening April 7th-9th in Dallas, Texas, has officially announced their schedule for this year's event. This three day event (one training day and two days of regular sessions) will feature talks like:

  • "Is Your API Misbehaving?" (Keith Casey)
  • "TDD with PhpSpec" (Ciaran McNulty)
  • "Stop multiplying by 4: Practical software estimation" (Chuck Reeves)
  • "Writing Workers For Scalable Application" (Gary Hockin)
  • "Demystifying OAuth2: an understandable way to approach connecting to other systems" (Joseph Maxwell)
  • "Building PHP Daemons & Long Running Processes" (Tim Lytle)
  • "The Present and Future of WordPress's REST API" (David Hayes)

...and many more. Be sure to check out the whole schedule for more information and descriptions of these and other sessions happening over the three-day event. Tickets are also already on sale if you'd like to grab them at Early Bird prices while you can!

tagged: lonestarphp conference schedule lsp16 announcement dallas

Link: http://lonestarphp.com/schedule/