Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Laravel Zero
Search
Hunter Skrasek
May 03, 2018
Programming
180
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Laravel Zero
Talk presented at
https://www.meetup.com/Laravel-Austin/events/jrzzbpyxhbfb/
Hunter Skrasek
May 03, 2018
Transcript
20 slides
Laravel Zero Laravel Zero - Laravel Austin 1
Micro-framework for command-line applications Provides an elegant starting point for
your console application Laravel Zero - Laravel Austin 2
Installation Laravel Zero - Laravel Austin 3
Installation — composer global require "laravel-zero/installer" Laravel Zero - Laravel
Austin 3
Installation — composer global require "laravel-zero/installer" — composer create-project --prefer-dist
laravel-zero/ laravel-zero movie-cli Laravel Zero - Laravel Austin 3
Commands By default Laravel Zero comes with a InspiringCommand as
an example php <your-app-name> make:command <NewCommand> Laravel Zero - Laravel Austin 4
Desktop Notifications $this->notify("Hello Web Artisan", "Love beautiful..", "icon.png"); Laravel Zero
- Laravel Austin 5
Tasks $this->task("Installing Laravel", function () { return true; }); $this->task("Doing
something else", function () { return false; }); Laravel Zero - Laravel Austin 6
Interactive Menus $option = $this->menu('Pizza menu', [ 'Freshly baked muffins',
'Freshly baked croissants', 'Turnovers, crumb cake, cinnamon buns, scones', ])->open(); $this->info("You have chosen the option number #$option"); $this->menu($title, $options) ->setForegroundColour('green') ->setBackgroundColour('black') ->setWidth(200) ->setPadding(10) ->setMargin(5) ->setExitButtonText("Abort") // remove exit button with // ->disableDefaultItems() ->setUnselectedMarker('❅') ->setSelectedMarker('✏') ->setTitleSeparator('*-') ->addLineBreak('<3', 2) ->addStaticItem('AREA 2') ->open(); Laravel Zero - Laravel Austin 7
Service Providers Laravel Zero recommends using Service Providers for defining
concrete implementations Laravel Zero - Laravel Austin 8
Config Laravel Zero utilizes the same configuration system as Laravel.
'production' => true, Laravel Zero - Laravel Austin 9
Database Laravel Zero allows you to install a Laravel's Eloquent
component php <your-app-name> app:install database Laravel Zero - Laravel Austin 10
Logging php <your-app-name> app:install log Laravel Zero - Laravel Austin
11
Filesystem Laravel Zero ships with the Filesystem component by default
use Illuminate\Support\Facades\Storage; Storage::put("reminders.txt", "Task 1"); Laravel Zero - Laravel Austin 12
Scheduler Laravel Zero ships with the Task Scheduling system of
Laravel * * * * * php /path-to-your-project/your-app-name schedule:run >> /dev/null 2>&1 public function schedule(Schedule $schedule): void { $schedule->command(static::class)->everyMinute(); } Laravel Zero - Laravel Austin 13
Environment Configuration Laravel Zero also supports DotEnv based environment configuration
php <your-app-name> app:install dotenv Laravel Zero - Laravel Austin 14
Collision A detailed and intuitive error handler framework for console
applications Laravel Zero - Laravel Austin 15
Tinker Laravel Zero is a powerful REPL for Laravel Laravel
Zero - Laravel Austin 16
Tests use Tests\TestCase; use Illuminate\Support\Facades\Artisan; class InspiringCommandTest extends TestCase {
/** * A basic test example. */ public function testInspiringCommand(): void { Artisan::call('inspiring'); $this->assertContains('Leonardo da Vinci', Artisan::output()); } } Laravel Zero - Laravel Austin 17
DEMO Laravel Zero - Laravel Austin 18
More Decks by Hunter Skrasek
See All by Hunter Skrasek
Type Safety and Compilation Checks: How Static Analysis Can Benefit Your Team
hskrasek
0
140
Papers, Please! API Authentication with Laravel Passport
hskrasek
1
780
Laravel Doctrine
hskrasek
1
500
How Laravel Makes Your Life Easier
hskrasek
0
160
Refactoring to Collections
hskrasek
2
1.4k
API's and You - Pt. 2
hskrasek
0
120
API's and You
hskrasek
2
180
Other Decks in Programming
See All in Programming
止まらない比較を止める — 余帰納法で無限ストリームを比べる
tarao
0
220
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
3
680
Stage 3でも仕様は変わる。アプリケーション開発者のためのTC39プロセスの読み方
bicstone
1
1.2k
baseline으로 마이그레이션, 리팩토링 안전하게 맡기기
fornewid
1
1.1k
protojson における文字化けの扱い
kazuki1023
0
470
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
150
joyful-journey-spring-boot.pdf
hollycummins
0
130
テストだけで見つかる? Rubyでつくるメソッド発掘器
izawa
0
180
初学者向け 分散トレーシングとDatadog
mtaka1222
0
110
コード生成時代のAPI定義を支えるRequest Spec移行
pvcresin
0
320
Rails初心者がパスキーを実装してみて大変だったこと
ktombow
0
250
R言語プログラミング
profjoesuzuki
0
140
Featured
See All Featured
It's Worth the Effort
3n
188
30k
Amusing Abliteration
ianozsvald
1
410
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
3k
Faster Mobile Websites
deanohume
310
32k
What's in a price? How to price your products and services
michaelherold
247
13k
Designing for Timeless Needs
cassininazir
1
570
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
1k
Between Models and Reality
mayunak
4
610
Designing Powerful Visuals for Engaging Learning
tmiket
1
670
Automating Front-end Workflow
addyosmani
1370
210k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
380