diff --git a/README.md b/README.md index c7d5e0f27848..de925a4d3d16 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,36 @@ -# Laravel Framework (Kernel) +

-[![StyleCI](https://styleci.io/repos/7548986/shield?style=flat)](https://styleci.io/repos/7548986) -[![Build Status](https://travis-ci.org/laravel/framework.svg)](https://travis-ci.org/laravel/framework) -[![Total Downloads](https://poser.pugx.org/laravel/framework/d/total.svg)](https://packagist.org/packages/laravel/framework) -[![Latest Stable Version](https://poser.pugx.org/laravel/framework/v/stable.svg)](https://packagist.org/packages/laravel/framework) -[![Latest Unstable Version](https://poser.pugx.org/laravel/framework/v/unstable.svg)](https://packagist.org/packages/laravel/framework) -[![License](https://poser.pugx.org/laravel/framework/license.svg)](https://packagist.org/packages/laravel/framework) +

+Build Status +Total Downloads +Latest Stable Version +License +

+ +## About Laravel > **Note:** This repository contains the core code of the Laravel framework. If you want to build an application using Laravel 5, visit the main [Laravel repository](https://github.com/laravel/laravel). -## Laravel PHP Framework +Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as: + +- [Simple, fast routing engine](https://laravel.com/docs/routing). +- [Powerful dependency injection container](https://laravel.com/docs/container). +- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. +- Database agnostic [schema migrations](https://laravel.com/docs/migrations). +- [Robust background job processing](https://laravel.com/docs/queues). +- [Real-time event broadcasting](https://laravel.com/docs/broadcasting). -Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, queueing, and caching. +Laravel is accessible, yet powerful, providing tools needed for large, robust applications. A superb combination of simplicity, elegance, and innovation give you tools you need to build any application with which you are tasked. -Laravel is accessible, yet powerful, providing powerful tools needed for large, robust applications. A superb inversion of control container, expressive migration system, and tightly integrated unit testing support give you the tools you need to build any application with which you are tasked. +## Learning Laravel -## Official Documentation +Laravel has the most extensive and thorough documentation and video tutorial library of any modern web application framework. The [Laravel documentation](https://laravel.com/docs) is thorough, complete, and makes it a breeze to get started learning the framework. -Documentation for the framework can be found on the [Laravel website](https://laravel.com/docs). +If you're not in the mood to read, [Laracasts](https://laracasts.com) contains over 900 video tutorial on a range of topics including Laravel, modern PHP, unit testing, JavaScript, and more. Boost the skill level of yourself and your entire team by digging into our comprehensive video library. ## Contributing -Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). +Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](http://laravel.com/docs/contributions). ## Security Vulnerabilities diff --git a/src/Illuminate/Notifications/Channels/MailChannel.php b/src/Illuminate/Notifications/Channels/MailChannel.php index 8416ed57d084..5b324c0b13e7 100644 --- a/src/Illuminate/Notifications/Channels/MailChannel.php +++ b/src/Illuminate/Notifications/Channels/MailChannel.php @@ -59,6 +59,10 @@ public function send($notifiable, Notification $notification) $m->to($recipients); } + if ($message->cc) { + $m->cc($message->cc); + } + $m->subject($message->subject ?: Str::title( Str::snake(class_basename($notification), ' ') )); diff --git a/src/Illuminate/Notifications/Messages/MailMessage.php b/src/Illuminate/Notifications/Messages/MailMessage.php index df05ce992fa0..b76e295d8f8c 100644 --- a/src/Illuminate/Notifications/Messages/MailMessage.php +++ b/src/Illuminate/Notifications/Messages/MailMessage.php @@ -35,6 +35,13 @@ class MailMessage extends SimpleMessage */ public $to = []; + /** + * The "cc" recipients of the message. + * + * @var array + */ + public $cc = []; + /** * The attachments for the message. * @@ -98,6 +105,19 @@ public function to($address) return $this; } + /** + * Set the recipients of the message. + * + * @param string|array $address + * @return $this + */ + public function cc($address) + { + $this->cc = $address; + + return $this; + } + /** * Attach a file to the message. * diff --git a/src/Illuminate/Routing/Console/ControllerMakeCommand.php b/src/Illuminate/Routing/Console/ControllerMakeCommand.php index f4419dd90393..d61932731451 100755 --- a/src/Illuminate/Routing/Console/ControllerMakeCommand.php +++ b/src/Illuminate/Routing/Console/ControllerMakeCommand.php @@ -61,7 +61,7 @@ protected function getDefaultNamespace($rootNamespace) protected function getOptions() { return [ - ['resource', null, InputOption::VALUE_NONE, 'Generate a resource controller class.'], + ['resource', 'r', InputOption::VALUE_NONE, 'Generate a resource controller class.'], ]; } diff --git a/src/Illuminate/Validation/Rules/Exists.php b/src/Illuminate/Validation/Rules/Exists.php index b67ba03f3046..017043d4ec1b 100644 --- a/src/Illuminate/Validation/Rules/Exists.php +++ b/src/Illuminate/Validation/Rules/Exists.php @@ -102,7 +102,8 @@ public function whereNotNull($column) /** * Register a custom query callback. * - * @param \Closure $callback + * @param \Closure $callback + * @return $this */ public function using(Closure $callback) { diff --git a/src/Illuminate/Validation/Rules/Unique.php b/src/Illuminate/Validation/Rules/Unique.php index a803bc43b508..8285634af319 100644 --- a/src/Illuminate/Validation/Rules/Unique.php +++ b/src/Illuminate/Validation/Rules/Unique.php @@ -131,7 +131,8 @@ public function ignore($id, $idColumn = 'id') /** * Register a custom query callback. * - * @param \Closure $callback + * @param \Closure $callback + * @return $this */ public function using(Closure $callback) { diff --git a/tests/Notifications/NotificationMailChannelTest.php b/tests/Notifications/NotificationMailChannelTest.php index 33dba51235fe..a7f5c6d1a9ae 100644 --- a/tests/Notifications/NotificationMailChannelTest.php +++ b/tests/Notifications/NotificationMailChannelTest.php @@ -211,6 +211,37 @@ public function testMessageWithToAddress() $channel->send($notifiable, $notification); } + public function testMessageWithToCcEmails() + { + $notification = new NotificationMailChannelTestNotificationWithCcEmails; + $notifiable = new NotificationMailChannelTestNotifiable; + + $message = $notification->toMail($notifiable); + $data = $message->toArray(); + + $channel = new Illuminate\Notifications\Channels\MailChannel( + $mailer = Mockery::mock(Illuminate\Contracts\Mail\Mailer::class) + ); + + $views = ['notifications::email', 'notifications::email-plain']; + + $mailer->shouldReceive('send')->with($views, $data, Mockery::on(function ($closure) { + $mock = Mockery::mock('Illuminate\Mailer\Message'); + + $mock->shouldReceive('subject')->once(); + + $mock->shouldReceive('to')->once()->with('taylor@laravel.com'); + + $mock->shouldReceive('cc')->once()->with(['cc1@email.com', 'cc2@email.com']); + + $closure($mock); + + return true; + })); + + $channel->send($notifiable, $notification); + } + public function testMessageWithPriority() { $notification = new NotificationMailChannelTestNotificationWithPriority; @@ -318,6 +349,15 @@ public function toMail($notifiable) } } +class NotificationMailChannelTestNotificationWithCcEmails extends Notification +{ + public function toMail($notifiable) + { + return (new MailMessage) + ->cc(['cc1@email.com', 'cc2@email.com']); + } +} + class NotificationMailChannelTestNotificationWithPriority extends Notification { public function toMail($notifiable) diff --git a/tests/Support/SupportCollectionTest.php b/tests/Support/SupportCollectionTest.php index 748c5e85551b..2e0562232004 100755 --- a/tests/Support/SupportCollectionTest.php +++ b/tests/Support/SupportCollectionTest.php @@ -634,6 +634,23 @@ public function testSortByString() $this->assertEquals([['name' => 'dayle'], ['name' => 'taylor']], array_values($data->all())); } + public function testSortByAlwaysReturnsAssoc() + { + $data = new Collection(['a' => 'taylor', 'b' => 'dayle']); + $data = $data->sortBy(function ($x) { + return $x; + }); + + $this->assertEquals(['b' => 'dayle', 'a' => 'taylor'], $data->all()); + + $data = new Collection(['taylor', 'dayle']); + $data = $data->sortBy(function ($x) { + return $x; + }); + + $this->assertEquals([1 => 'dayle', 0 => 'taylor'], $data->all()); + } + public function testReverse() { $data = new Collection(['zaeed', 'alan']);