Skip to content

Commit

Permalink
Merge pull request #4 from designmynight/3.2-maatwebsite
Browse files Browse the repository at this point in the history
Upgrade to 3.2
  • Loading branch information
jmosul authored Mar 18, 2019
2 parents e9231f9 + 5da6f0c commit 174df1d
Show file tree
Hide file tree
Showing 107 changed files with 4,610 additions and 974 deletions.
2 changes: 1 addition & 1 deletion .github/issuecomplete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ labelName: more information needed
# The text of the comment to add to the issue in addition to the label
commentText: >
Thanks for submitting the ticket. Unfortunately the information you provided is incomplete. We need to know which version you use and how to reproduce it. Please include code examples. Before we can pick it up, please check (https://github.com/Maatwebsite/Laravel-Excel/blob/3.1/.github/ISSUE_TEMPLATE.md) and add the missing information.
To make processing of this ticket a lot easier, please make sure to check (https://laravel-excel.maatwebsite.nl/docs/3.1/getting-started/contributing) and double-check if you have filled in the issue template correctly. This will allow us to pick up your ticket more efficiently. Issues that follow the guidelines correctly will get priority over other issues.
To make processing of this ticket a lot easier, please make sure to check (https://laravel-excel.maatwebsite.nl/3.1/getting-started/contributing.html) and double-check if you have filled in the issue template correctly. This will allow us to pick up your ticket more efficiently. Issues that follow the guidelines correctly will get priority over other issues.
# Whether or not to ensure all checkboxes are checked
checkCheckboxes: false
Expand Down
16 changes: 12 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ matrix:
fast_finish: true
include:
# Laravel 5.5
- php: 7.0
env: LARAVEL=5.5.* TESTBENCH=3.5.* ORCHESTRA_DATABASE=3.5.* PHPUNIT=~6.0
- php: 7.1
env: LARAVEL=5.5.* TESTBENCH=3.5.* ORCHESTRA_DATABASE=3.5.* PHPUNIT=~6.0
- php: 7.2
Expand All @@ -28,9 +26,19 @@ matrix:

# Laravel 5.7
- php: 7.1
env: LARAVEL=5.7.* TESTBENCH=3.7.* ORCHESTRA_DATABASE=3.7.*@dev PHPUNIT=~7.0
env: LARAVEL=5.7.* TESTBENCH=3.7.* ORCHESTRA_DATABASE=3.7.* PHPUNIT=~7.5
- php: 7.2
env: LARAVEL=5.7.* TESTBENCH=3.7.* ORCHESTRA_DATABASE=3.7.* PHPUNIT=~7.5
- php: 7.3
env: LARAVEL=5.7.* TESTBENCH=3.7.* ORCHESTRA_DATABASE=3.7.* PHPUNIT=~7.5

# Laravel 5.8
- php: 7.1
env: LARAVEL=5.8.* TESTBENCH=3.8.* ORCHESTRA_DATABASE=3.8.* PHPUNIT=~7.5
- php: 7.2
env: LARAVEL=5.7.* TESTBENCH=3.7.* ORCHESTRA_DATABASE=3.7.*@dev PHPUNIT=~7.0
env: LARAVEL=5.8.* TESTBENCH=3.8.* ORCHESTRA_DATABASE=3.8.* PHPUNIT=~8.0
- php: 7.3
env: LARAVEL=5.8.* TESTBENCH=3.8.* ORCHESTRA_DATABASE=3.8.* PHPUNIT=~8.0

before_install:
- phpenv config-rm xdebug.ini
Expand Down
176 changes: 33 additions & 143 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@


<p align="center">
<a href="https://laravel-excel.maatwebsite.nl">
<a href="https://laravel-excel.com">
<img alt="Laravel Excel" src="https://user-images.githubusercontent.com/7728097/43685313-ff1e2110-98b0-11e8-8b50-900a2b262f0f.png" />
</a>
</p>
Expand All @@ -10,20 +8,6 @@
Laravel Excel 3.1
</h1>

<p align="center">

<a href="https://medium.com/maatwebsite/celebrating-5-years-of-laravel-excel-d0416eebca20">
<img alt="Laravel Excel" src="https://user-images.githubusercontent.com/7728097/48266170-df40e200-e42e-11e8-9bc1-f0adc7145c9e.png" />
</a>
</p>

<h3 align="center">
🎉 Celebrating 5 years of Laravel Excel. Read more on <a href="https://medium.com/maatwebsite/celebrating-5-years-of-laravel-excel-d0416eebca20">our blog!</a>
</h3>

<p></p>


<h3 align="center">
:muscle: :fire: :rocket:
</h3>
Expand Down Expand Up @@ -56,18 +40,27 @@ exports and imports.
</a>
</p>

<div style="text-align:center;">

| 🎥 COURSE: "Advanced Laravel Excel". Grab your early-bird discount now! https://course.laravel-excel.com |
| --- |

</div>

<h4 align="center">
<a href="https://laravel-excel.maatwebsite.nl/3.1/exports/">Quickstart</a>
<a href="https://docs.laravel-excel.com/3.1/exports/">Quickstart</a>
<span> · </span>
<a href="https://docs.laravel-excel.com/3.1/getting-started/">Documentation</a>
<span> · </span>
<a href="https://laravel-excel.maatwebsite.nl/3.1/getting-started/">Documentation</a>
<a href="https://course.laravel-excel.com">Video Course</a>
<span> · </span>
<a href="https://github.com/Maatwebsite/Laravel-Nova-Excel">Nova</a>
<span> · </span>
<a href="https://medium.com/maatwebsite/laravel-excel/home">Blog</a>
<span> · </span>
<a href="https://laravel-excel.maatwebsite.nl/3.1/getting-started/contributing.html">Contributing</a>
<a href="https://docs.laravel-excel.com/3.1/getting-started/contributing.html">Contributing</a>
<span> · </span>
<a href="https://laravel-excel.maatwebsite.nl/3.1/getting-started/support.html">Support</a>
<a href="https://docs.laravel-excel.com/3.1/getting-started/support.html">Support</a>
</h4>

- **Easily export collections to Excel.** Supercharge your Laravel collections and export them directly to an Excel or CSV document. Exporting has never been so easy.
Expand All @@ -78,127 +71,37 @@ exports and imports.

- **Export Blade views.** Want to have a custom layout in your spreadsheet? Use a HTML table in a Blade view and export that to Excel.

## :rocket: 5 minutes quick start for exports

:bulb: Require this package in the `composer.json` of your Laravel project. This will download the package and PhpSpreadsheet.

```
composer require maatwebsite/excel
```

:muscle: Create an export class in `App/Exports`

```
php artisan make:export UsersExport --model=User
```

This should have created:

```php
<?php

namespace App\Exports;

use App\User;
use Maatwebsite\Excel\Concerns\FromCollection;

class UsersExport implements FromCollection
{
public function collection()
{
return User::all();
}
}
```

:fire: In your controller you can call this export now:

```php

use App\Exports\UsersExport;
use Maatwebsite\Excel\Facades\Excel;
use App\Http\Controllers\Controller;

class UsersController extends Controller
{
public function export()
{
return Excel::download(new UsersExport, 'users.xlsx');
}
}
```

:page_facing_up: Find your `users.xlsx` in your downloads folder!

More installation instructions can be found at: [https://laravel-excel.maatwebsite.nl/3.1/getting-started/installation.html](https://laravel-excel.maatwebsite.nl/3.1/getting-started/installation.html)

## :rocket: 5 minutes quick start for imports

:muscle: Create an import class in `App\Imports`

You may do this by using the `make:import` command.

```
php artisan make:import UsersImport --model=User
```
## 🎓 Learning Laravel Excel

If you prefer to create the import manually, you can create the following in `App\Imports`:
You can find the full documentation of Laravel Excel [on the website](https://docs.laravel-excel.com).

```php
<?php
We welcome suggestions for improving our docs. The documentation repository can be found at [https://github.com/Maatwebsite/laravel-excel-docs](https://github.com/Maatwebsite/laravel-excel-docs).

namespace App\Imports;
Some articles and tutorials can be found on our blog: https://medium.com/maatwebsite/laravel-excel/home

use App\User;
use Illuminate\Support\Facades\Hash;
use Maatwebsite\Excel\Concerns\ToModel;
## 🎥 Video Course

class UsersImport implements ToModel
{
/**
* @param array $row
*
* @return User|null
*/
public function model(array $row)
{
return new User([
'name' => $row[0],
'email' => $row[1],
'password' => Hash::make($row[2]),
]);
}
}
```
![1_bzlh2ituv5x7yu2wenhxxw](https://user-images.githubusercontent.com/7728097/53638298-188f9e80-3c26-11e9-82c8-baf057271013.jpeg)

:fire: In your controller you can call this import now:
We are currently building a video course called "Advanced Laravel Excel". In this video course we’ll build a small application with real-life, complex imports and exports that go beyond simple user imports and exports. We’ll go step-by-step and tackle implementing Laravel Excel in a performant way.

```php
If you sign up now, you’ll get notified when the course launches and get it for the early bird price of $69 instead of ~~$99~~.

use App\Imports\UsersImport;
use Maatwebsite\Excel\Facades\Excel;
use App\Http\Controllers\Controller;
https://course.laravel-excel.com

class UsersController extends Controller
{
public function import()
{
Excel::import(new UsersImport, 'users.xlsx');

return redirect('/')->with('success', 'All good!');
}
}
```
## :mailbox_with_mail: License & Postcardware

:page_facing_up: Find the imported users in your database!
![1_5nblgs68uarg0wxxejozdq](https://user-images.githubusercontent.com/7728097/53638144-9e5f1a00-3c25-11e9-9f4a-fc71c9d94562.jpg)

## 🎓 Learning Laravel Excel
Laravel Excel is completely free (MIT license) to use, however the package is licensed as Postcardware. This means that if it makes it to your production environment, we would very much appreciate receiving a postcard from your hometown.

You can find the full documentation of Laravel Excel [on the website](https://laravel-excel.maatwebsite.nl/).
**Maatwebsite**
Markt 2
6231 LS Meerssen
The Netherlands

We welcome suggestions for improving our docs. The documentation repository can be found at [https://github.com/Maatwebsite/laravel-excel-docs](https://github.com/Maatwebsite/laravel-excel-docs).
More about the license can be found at: [https://docs.laravel-excel.com/3.1/getting-started/license.html](https://docs.laravel-excel.com/3.1/getting-started/license.html)

Read some articles and tutorials can be found on our blog: https://laravel-excel.maatwebsite.nl/blog/

## :wrench: Supported Versions

Expand All @@ -207,18 +110,5 @@ Versions will be supported for a limited amount of time.
| Version | Laravel Version | Php Version | Support |
|---- |----|----|----|
| 2.1 | <=5.6 | <=7.0 | Unsupported since 15-5-2018 |
| 3.0 | ^5.5 | ^7.0 | Security fixes till 31-12-2018 |
| 3.1 | ^5.5 | ^7.0 | New features |

## :mailbox_with_mail: License & Postcardware

Our software is open source and licensed under the MIT license.

If you use the software in your production environment we would appreciate to receive a postcard of your hometown. Please send it to:

**Maatwebsite**
Florijnruwe 111-2
6218 CA Maastricht
The Netherlands

More about the license can be found at: [https://laravel-excel.maatwebsite.nl/3.1/getting-started/license.html](https://laravel-excel.maatwebsite.nl/3.1/getting-started/license.html)
| 3.0 | ^5.5 | ^7.0 | Unsupported since 31-12-2018 |
| 3.1 | ^5.5 | ^7.1 | New features |
16 changes: 10 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@
}
],
"require": {
"ext-json": "*",
"php": "^7.0",
"phpoffice/phpspreadsheet": "^1.4",
"illuminate/support": "5.5.* || 5.6.* || 5.7.*"
"phpoffice/phpspreadsheet": "^1.6",
"illuminate/support": "5.5.*|5.6.*|5.7.*|5.8.*",
"opis/closure": "^3.1"
},
"require-dev": {
"phpunit/phpunit": "^7.0",
"phpunit/phpunit": "^8.0",
"mockery/mockery": "^1.1",
"orchestra/testbench": "^3.6",
"orchestra/database": "^3.6",
"orchestra/testbench": "^3.8",
"orchestra/database": "^3.8",
"predis/predis": "^1.1"
},
"autoload": {
Expand All @@ -50,5 +52,7 @@
"Excel": "Maatwebsite\\Excel\\Facades\\Excel"
}
}
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
Loading

0 comments on commit 174df1d

Please sign in to comment.