Skip to content

Commit

Permalink
Merge branch '5.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Oct 28, 2016
2 parents 2e99611 + 172f9d6 commit 6a1f671
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 16 deletions.
35 changes: 22 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
# Laravel Framework (Kernel)
<p align="center"><a href="https://laravel.com" target="_blank"><img width="150"src="https://laravel.com/laravel.png"></a></p>

[![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)
<p align="center">
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/d/total.svg" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/v/stable.svg" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/license.svg" alt="License"></a>
</p>

## 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

Expand Down
4 changes: 4 additions & 0 deletions src/Illuminate/Notifications/Channels/MailChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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), ' ')
));
Expand Down
20 changes: 20 additions & 0 deletions src/Illuminate/Notifications/Messages/MailMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Routing/Console/ControllerMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.'],
];
}

Expand Down
3 changes: 2 additions & 1 deletion src/Illuminate/Validation/Rules/Exists.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Illuminate/Validation/Rules/Unique.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
40 changes: 40 additions & 0 deletions tests/Notifications/NotificationMailChannelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
17 changes: 17 additions & 0 deletions tests/Support/SupportCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down

0 comments on commit 6a1f671

Please sign in to comment.