Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Console Apps:
php artisan forthe:win
Joe Ferguson
Who Am I?
Joe Ferguson
PHP Developer
Engineer @ Aol.
Twitter: @JoePFerguson
Organizer of @MemphisPHP
OSMI Board Member
@No...
For Further Reading
https://leanpub.com/signalingphp
Console Apps?!
Shouldn’t we be doing
this in __________ ?
Symfony Console
http://symfony.com/doc/current/components/console.html
Symfony Console
Artisan Console
Laravel Artisan
https://laravel.com/docs/5.3/artisan
Artisan Commands
Create a new Command
Create a new Command
app/Console/Kernel.php
BasicCommand.php
Signature
Description
Constructor
Handle The Command
Running our Command
Output Some Text
Output Some Text
Output Warning Text
Output Warning Text
Output Error Text
Output Error Text
How do we test the
Command?
BasicCommandTest
BasicCommandTest
Adding Checks
BasicCommandTest
Database Backup
Create
DatabaseBackupCommand
app/Console/Commands
Don’t forget Kernel.php!
app/Console/Commands
Look for our Command
Write our handle()
Write our handle()
But we use RDS!
Command SnapshotRds
Write our __construct()
Write our handle()
Running Our Command
AWS Console
I can do that automatically…
What if you don’t use RDS?
spatie/laravel-backup
AWS S3 File Storage
Configure
S3ExampleCommand
List items in a bucket
List items in a bucket
Get an object by Key
Get an object by Key
Deleting old assets
Deleting old assets
Cache Data From APIs
Configure
CacheApiDataCommand
dms/meetup-api-client
meetupConnect()
handle()
Command Arguments
Default in $signature
We need a way to
persist the API data…
Database to the rescue!
Empty Migration
Event Details
Migration up()
Migration down()
Run Migrations
Create Meetup Model
Process the events
Check the database
Now we can pull events
from our database
Elasticsearch
20 Events is a pretty
small data set
GetAllMeetups*
*not all meetups
GetAllMeetups
Command
A larger meetup group
Update the handle()
Run our command
Check the database
Batch Process Large
Data Sets
Configure
BatchProcessCommand
handle()
BatchProcessCommand
Running meetup:expire
Schedule Our
Commands
artisan schedule:run
Scheduling Commands
app/Console/Kernel.php
Scheduling Commands
Real World Twitter
Demo
Questions?
Feedback!
https://joind.in/talk/2045d
Joe Ferguson
Twitter: @JoePFerguson
Email: joe@joeferguson.me
Freenode: joepferguson...
Upcoming SlideShare
Loading in …5
×

of

Console Apps: php artisan forthe:win Slide 1 Console Apps: php artisan forthe:win Slide 2 Console Apps: php artisan forthe:win Slide 3 Console Apps: php artisan forthe:win Slide 4 Console Apps: php artisan forthe:win Slide 5 Console Apps: php artisan forthe:win Slide 6 Console Apps: php artisan forthe:win Slide 7 Console Apps: php artisan forthe:win Slide 8 Console Apps: php artisan forthe:win Slide 9 Console Apps: php artisan forthe:win Slide 10 Console Apps: php artisan forthe:win Slide 11 Console Apps: php artisan forthe:win Slide 12 Console Apps: php artisan forthe:win Slide 13 Console Apps: php artisan forthe:win Slide 14 Console Apps: php artisan forthe:win Slide 15 Console Apps: php artisan forthe:win Slide 16 Console Apps: php artisan forthe:win Slide 17 Console Apps: php artisan forthe:win Slide 18 Console Apps: php artisan forthe:win Slide 19 Console Apps: php artisan forthe:win Slide 20 Console Apps: php artisan forthe:win Slide 21 Console Apps: php artisan forthe:win Slide 22 Console Apps: php artisan forthe:win Slide 23 Console Apps: php artisan forthe:win Slide 24 Console Apps: php artisan forthe:win Slide 25 Console Apps: php artisan forthe:win Slide 26 Console Apps: php artisan forthe:win Slide 27 Console Apps: php artisan forthe:win Slide 28 Console Apps: php artisan forthe:win Slide 29 Console Apps: php artisan forthe:win Slide 30 Console Apps: php artisan forthe:win Slide 31 Console Apps: php artisan forthe:win Slide 32 Console Apps: php artisan forthe:win Slide 33 Console Apps: php artisan forthe:win Slide 34 Console Apps: php artisan forthe:win Slide 35 Console Apps: php artisan forthe:win Slide 36 Console Apps: php artisan forthe:win Slide 37 Console Apps: php artisan forthe:win Slide 38 Console Apps: php artisan forthe:win Slide 39 Console Apps: php artisan forthe:win Slide 40 Console Apps: php artisan forthe:win Slide 41 Console Apps: php artisan forthe:win Slide 42 Console Apps: php artisan forthe:win Slide 43 Console Apps: php artisan forthe:win Slide 44 Console Apps: php artisan forthe:win Slide 45 Console Apps: php artisan forthe:win Slide 46 Console Apps: php artisan forthe:win Slide 47 Console Apps: php artisan forthe:win Slide 48 Console Apps: php artisan forthe:win Slide 49 Console Apps: php artisan forthe:win Slide 50 Console Apps: php artisan forthe:win Slide 51 Console Apps: php artisan forthe:win Slide 52 Console Apps: php artisan forthe:win Slide 53 Console Apps: php artisan forthe:win Slide 54 Console Apps: php artisan forthe:win Slide 55 Console Apps: php artisan forthe:win Slide 56 Console Apps: php artisan forthe:win Slide 57 Console Apps: php artisan forthe:win Slide 58 Console Apps: php artisan forthe:win Slide 59 Console Apps: php artisan forthe:win Slide 60 Console Apps: php artisan forthe:win Slide 61 Console Apps: php artisan forthe:win Slide 62 Console Apps: php artisan forthe:win Slide 63 Console Apps: php artisan forthe:win Slide 64 Console Apps: php artisan forthe:win Slide 65 Console Apps: php artisan forthe:win Slide 66 Console Apps: php artisan forthe:win Slide 67 Console Apps: php artisan forthe:win Slide 68 Console Apps: php artisan forthe:win Slide 69 Console Apps: php artisan forthe:win Slide 70 Console Apps: php artisan forthe:win Slide 71 Console Apps: php artisan forthe:win Slide 72 Console Apps: php artisan forthe:win Slide 73 Console Apps: php artisan forthe:win Slide 74 Console Apps: php artisan forthe:win Slide 75 Console Apps: php artisan forthe:win Slide 76 Console Apps: php artisan forthe:win Slide 77 Console Apps: php artisan forthe:win Slide 78 Console Apps: php artisan forthe:win Slide 79 Console Apps: php artisan forthe:win Slide 80 Console Apps: php artisan forthe:win Slide 81 Console Apps: php artisan forthe:win Slide 82 Console Apps: php artisan forthe:win Slide 83 Console Apps: php artisan forthe:win Slide 84 Console Apps: php artisan forthe:win Slide 85 Console Apps: php artisan forthe:win Slide 86 Console Apps: php artisan forthe:win Slide 87 Console Apps: php artisan forthe:win Slide 88 Console Apps: php artisan forthe:win Slide 89 Console Apps: php artisan forthe:win Slide 90 Console Apps: php artisan forthe:win Slide 91 Console Apps: php artisan forthe:win Slide 92
Upcoming SlideShare
Vagrant - Team Development made easy
Next
Download to read offline and view in fullscreen.

0 Likes

Share

Download to read offline

Console Apps: php artisan forthe:win

Download to read offline

Laravel is a great framework to use for web applications but what if you need to do more? What if you need to process data that would take longer than an HTTP request would allow?

Come learn how to harness the power of the console in your Laravel applications to do various tasks such as caching data from 3rd party APIs, expire old content from S3 or other data store, and batch process huge data sets without users having to wait for results. You can even automate tasks such as backing up your remote databases before you run migrations with artisan commands.

We'll cover creating basic artisan console commands, adding options and passing input, setting up cron jobs and scheduling our console commands to run at specific times, and how you can utilize 3rd party APIs to create fun automated message processing for social media networks.

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all
  • Be the first to like this

Console Apps: php artisan forthe:win

  1. 1. Console Apps: php artisan forthe:win Joe Ferguson
  2. 2. Who Am I? Joe Ferguson PHP Developer Engineer @ Aol. Twitter: @JoePFerguson Organizer of @MemphisPHP OSMI Board Member @NomadPHP Lightning Talks Passionate about Community
  3. 3. For Further Reading https://leanpub.com/signalingphp
  4. 4. Console Apps?!
  5. 5. Shouldn’t we be doing this in __________ ?
  6. 6. Symfony Console http://symfony.com/doc/current/components/console.html
  7. 7. Symfony Console
  8. 8. Artisan Console
  9. 9. Laravel Artisan https://laravel.com/docs/5.3/artisan
  10. 10. Artisan Commands
  11. 11. Create a new Command
  12. 12. Create a new Command
  13. 13. app/Console/Kernel.php
  14. 14. BasicCommand.php
  15. 15. Signature
  16. 16. Description
  17. 17. Constructor
  18. 18. Handle The Command
  19. 19. Running our Command
  20. 20. Output Some Text
  21. 21. Output Some Text
  22. 22. Output Warning Text
  23. 23. Output Warning Text
  24. 24. Output Error Text
  25. 25. Output Error Text
  26. 26. How do we test the Command?
  27. 27. BasicCommandTest
  28. 28. BasicCommandTest
  29. 29. Adding Checks
  30. 30. BasicCommandTest
  31. 31. Database Backup
  32. 32. Create DatabaseBackupCommand
  33. 33. app/Console/Commands
  34. 34. Don’t forget Kernel.php!
  35. 35. app/Console/Commands
  36. 36. Look for our Command
  37. 37. Write our handle()
  38. 38. Write our handle()
  39. 39. But we use RDS!
  40. 40. Command SnapshotRds
  41. 41. Write our __construct()
  42. 42. Write our handle()
  43. 43. Running Our Command
  44. 44. AWS Console
  45. 45. I can do that automatically…
  46. 46. What if you don’t use RDS?
  47. 47. spatie/laravel-backup
  48. 48. AWS S3 File Storage
  49. 49. Configure S3ExampleCommand
  50. 50. List items in a bucket
  51. 51. List items in a bucket
  52. 52. Get an object by Key
  53. 53. Get an object by Key
  54. 54. Deleting old assets
  55. 55. Deleting old assets
  56. 56. Cache Data From APIs
  57. 57. Configure CacheApiDataCommand
  58. 58. dms/meetup-api-client
  59. 59. meetupConnect()
  60. 60. handle()
  61. 61. Command Arguments
  62. 62. Default in $signature
  63. 63. We need a way to persist the API data…
  64. 64. Database to the rescue!
  65. 65. Empty Migration
  66. 66. Event Details
  67. 67. Migration up()
  68. 68. Migration down()
  69. 69. Run Migrations
  70. 70. Create Meetup Model
  71. 71. Process the events
  72. 72. Check the database
  73. 73. Now we can pull events from our database
  74. 74. Elasticsearch
  75. 75. 20 Events is a pretty small data set
  76. 76. GetAllMeetups* *not all meetups
  77. 77. GetAllMeetups Command
  78. 78. A larger meetup group
  79. 79. Update the handle()
  80. 80. Run our command
  81. 81. Check the database
  82. 82. Batch Process Large Data Sets
  83. 83. Configure BatchProcessCommand
  84. 84. handle() BatchProcessCommand
  85. 85. Running meetup:expire
  86. 86. Schedule Our Commands
  87. 87. artisan schedule:run
  88. 88. Scheduling Commands app/Console/Kernel.php
  89. 89. Scheduling Commands
  90. 90. Real World Twitter Demo
  91. 91. Questions?
  92. 92. Feedback! https://joind.in/talk/2045d Joe Ferguson Twitter: @JoePFerguson Email: joe@joeferguson.me Freenode: joepferguson Contact Info:

Laravel is a great framework to use for web applications but what if you need to do more? What if you need to process data that would take longer than an HTTP request would allow? Come learn how to harness the power of the console in your Laravel applications to do various tasks such as caching data from 3rd party APIs, expire old content from S3 or other data store, and batch process huge data sets without users having to wait for results. You can even automate tasks such as backing up your remote databases before you run migrations with artisan commands. We'll cover creating basic artisan console commands, adding options and passing input, setting up cron jobs and scheduling our console commands to run at specific times, and how you can utilize 3rd party APIs to create fun automated message processing for social media networks.

Views

Total views

425

On Slideshare

0

From embeds

0

Number of embeds

2

Actions

Downloads

19

Shares

0

Comments

0

Likes

0

×