Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Laravel 5.x Cookbook

You're reading from  Laravel 5.x Cookbook

Product type Book
Published in Sep 2016
Publisher Packt
ISBN-13 9781786462084
Pages 402 pages
Edition 1st Edition
Languages
Authors (2):
Terry Matula Terry Matula
Profile icon Terry Matula
Alfred Nutile Alfred Nutile
Profile icon Alfred Nutile
View More author details

Table of Contents (17) Chapters

Laravel 5.x Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Setting Up and Installing Laravel 2. Using Composer Packages 3. Routing 4. Building Views and Adding Style 5. Working with Data 6. Adding Angular to Your App 7. Authentication, Security, and Subscriptions 8. Testing and Debugging Your Application 9. Adding Advanced Features to Your App 10. Deploying Your App Index

Creating scheduler to notify users of new comics


Now is the time for another superpower feature built into Laravel—scheduling! OK, it does not sound that exciting, but the fact that I can set one cron job on my server to do all my tasks makes it a lot easier to move my features from server to server. I will show here one example of how to use it based on the console command that I made previously.

Getting ready

A base install of Laravel is fine. If you follow the preceding recipe, you will have a decent size command to run via this scheduling example.

How to do it…

  1. In the previous recipe, we ran php artisan make:console GetUsersLatestsFavoritesConsole to get a console command. Then, I added some query work over there to make it do its thing.

  2. I then updated the code in app/Console/Commands/GetUsersLatestsFavoritesConsole.php to catch any issues and put them in the logs. This way, I can see when things go wrong, since I will not be running this at the command line. I will talk about this more in...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}