Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Last Month in PHP - February 2017

John Kary
February 01, 2017

Last Month in PHP - February 2017

Kansas City PHP User Group
February 1, 2017

John Kary

February 01, 2017
Tweet

More Decks by John Kary

Other Decks in Programming

Transcript

  1. Laravel 5.4 https://laravel.com/docs/5.4/releases • Laravel Dusk • Higher-order Collection methods

    • Markdown in email templates • Components and Slots in Blade templates
  2. Laravel 5.4 https://laravel.com/docs/5.4/releases • Laravel Dusk • Higher-order Collection methods

    • Markdown in email templates • Components and Slots in Blade templates • Job-level retry and timeout
  3. Laravel Dusk class ExampleTest extends DuskTestCase {
 public function testBasicExample()

    {
 $user = factory(User::class)->create([
 'email' => '[email protected]',
 ]);
 
 $this->browse(function ($browser) use ($user) {
 $browser->visit('/login')
 ->type('email', $user->email)
 ->type('password', 'secret')
 ->press('Login')
 ->assertPathIs('/home');
 });
 }
 }
  4. Collection Higher Order Functions $users = User::where('group', 'Development')->get(); // Without

    Collections
 $total = 0;
 foreach ($users as $user) {
 $total += $user->votes;
 }
 echo $total;
  5. Collection Higher Order Functions $users = User::where('group', 'Development')->get(); // Without

    Collections
 $total = 0;
 foreach ($users as $user) {
 $total += $user->votes;
 }
 echo $total; // With Laravel Collection functions
 $users->map(function ($user) {
 return $user->votes;
 })->sum();
  6. Collection Higher Order Functions $users = User::where('group', 'Development')->get(); // Without

    Collections
 $total = 0;
 foreach ($users as $user) {
 $total += $user->votes;
 }
 echo $total; // With Laravel Collection functions
 $users->map(function ($user) {
 return $user->votes;
 })->sum(); // With higher-order collection functions
 echo $users->sum->votes; // 12