Skip to content

Commit

Permalink
Use config helper instead of facade.
Browse files Browse the repository at this point in the history
  • Loading branch information
yajra committed Jan 22, 2017
1 parent d45b107 commit b2bbc19
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Services/DataTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Yajra\Datatables\Services;

use Illuminate\Contracts\View\Factory;
use Illuminate\Support\Facades\Config;
use Maatwebsite\Excel\Classes\LaravelExcelWorksheet;
use Maatwebsite\Excel\Writers\LaravelExcelWriter;
use Yajra\Datatables\Contracts\DataTableButtonsContract;
Expand Down Expand Up @@ -315,7 +314,7 @@ public function csv()
*/
public function pdf()
{
if ('snappy' == Config::get('datatables-buttons.pdf_generator', 'excel')) {
if ('snappy' == config('datatables-buttons.pdf_generator', 'excel')) {
return $this->snappyPdf();
} else {
$this->buildExcelFile()->download('pdf');
Expand All @@ -332,14 +331,14 @@ public function snappyPdf()
/** @var \Barryvdh\Snappy\PdfWrapper $snappy */
$snappy = app('snappy.pdf.wrapper');

$options = Config::get('datatables-buttons.snappy.options', [
$options = config('datatables-buttons.snappy.options', [
'no-outline' => true,
'margin-left' => '0',
'margin-right' => '0',
'margin-top' => '10mm',
'margin-bottom' => '10mm',
]);
$orientation = Config::get('datatables-buttons.snappy.orientation', 'landscape');
$orientation = config('datatables-buttons.snappy.orientation', 'landscape');

$snappy->setOptions($options)
->setOrientation($orientation);
Expand Down

0 comments on commit b2bbc19

Please sign in to comment.