Last Month in PHP - February 2017

D3e3f4ac37c02289f5dfed115949fc88?s=47 John Kary
February 01, 2017

Last Month in PHP - February 2017

Kansas City PHP User Group
February 1, 2017

D3e3f4ac37c02289f5dfed115949fc88?s=128

John Kary

February 01, 2017
Tweet

Transcript

  1. 1.
  2. 12.

    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
  3. 13.

    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
  4. 14.

    Laravel Dusk class ExampleTest extends DuskTestCase {
 public function testBasicExample()

    {
 $user = factory(User::class)->create([
 'email' => 'taylor@laravel.com',
 ]);
 
 $this->browse(function ($browser) use ($user) {
 $browser->visit('/login')
 ->type('email', $user->email)
 ->type('password', 'secret')
 ->press('Login')
 ->assertPathIs('/home');
 });
 }
 }
  5. 16.

    Collection Higher Order Functions $users = User::where('group', 'Development')->get(); // Without

    Collections
 $total = 0;
 foreach ($users as $user) {
 $total += $user->votes;
 }
 echo $total;
  6. 17.

    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();
  7. 18.

    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
  8. 25.
  9. 35.