Laravel 5.3 Tutorial for Beginners : How to upload Laravel project onto Hosting Server with subdomain, This lesson will show you how to Host Laravel 5.3 Project to Cpanel hosting.
Video Tutorial Deploying Laravel 5 to Production.
The Laravel framework has a few system requirements. Of course, all of these requirements are satisfied by the Laravel Homestead virtual machine, so it's highly recommended that you use Homestead as your local Laravel development environment.
However, if you are not using Homestead, you will need to make sure your server meets the following requirements:
Laravel 5.3 Tutorial for Beginners : How to upload Laravel project onto Hosting Server with subdomain, This lesson will show you how to Host Laravel 5.3 Project to Cpanel hosting.
Video Tutorial Deploying Laravel 5 to Production.
The Laravel framework has a few system requirements. Of course, all of these requirements are satisfied by the Laravel Homestead virtual machine, so it's highly recommended that you use Homestead as your local Laravel development environment.
However, if you are not using Homestead, you will need to make sure your server meets the following requirements:
Laravel 5.3 Tutorial for Beginners : How to upload Laravel project onto Hosting Server with subdomain, This lesson will show you how to Host Laravel 5.3 Project to Cpanel hosting.
Video Tutorial Deploying Laravel 5 to Production.
The Laravel framework has a few system requirements. Of course, all of these requirements are satisfied by the Laravel Homestead virtual machine, so it's highly recommended that you use Homestead as your local Laravel development environment.
However, if you are not using Homestead, you will need to make sure your server meets the following requirements:
Laravel 5.3 tutorial - How to export data from database into an Excel Spreadsheet or PDF Files in laravel 5.3?
Laravel Excel brings the power of PHPOffice's PHPExcel to Laravel 5 with a touch of the Laravel Magic. It includes features like: importing Excel and CSV to collections, exporting models, array's and views to Excel, importing batches of files and importing a file by a config file.
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use PDF; // pdf namespace
use Excel; // Excel namespace
use App\datatoPDF;
class PDFController extends Controller
{
// show all data
public function index(Request $req)
{
// show all data to index
$blogs = datatoPDF::all();
view()->share('blogs',$blogs);
// if request has pdf
if($req->has('downloadpdf')){
$pdf = PDF::loadView('pdf')->setPaper('a4', 'landscape');
return $pdf->download('pdf');
}
// if request has excel
if($req->has('downloadexcel')){
Excel::create('users', function($excel) use ($blogs) {
$excel->sheet('Sheet 1', function($sheet) use ($blogs) {
$sheet->fromArray($blogs);
});
})->export('xls');
}
// return index page
return view('index');
}
}
Models (datatoPDF.php)
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class datatoPDF extends Model
{
protected $table = 'users';
}
Laravel 5.3 tutorial - How to export data from database into an Excel Spreadsheet or PDF Files in laravel 5.3?
Laravel Excel brings the power of PHPOffice's PHPExcel to Laravel 5 with a touch of the Laravel Magic. It includes features like: importing Excel and CSV to collections, exporting models, array's and views to Excel, importing batches of files and importing a file by a config file.
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use PDF; // pdf namespace
use Excel; // Excel namespace
use App\datatoPDF;
class PDFController extends Controller
{
// show all data
public function index(Request $req)
{
// show all data to index
$blogs = datatoPDF::all();
view()->share('blogs',$blogs);
// if request has pdf
if($req->has('downloadpdf')){
$pdf = PDF::loadView('pdf')->setPaper('a4', 'landscape');
return $pdf->download('pdf');
}
// if request has excel
if($req->has('downloadexcel')){
Excel::create('users', function($excel) use ($blogs) {
$excel->sheet('Sheet 1', function($sheet) use ($blogs) {
$sheet->fromArray($blogs);
});
})->export('xls');
}
// return index page
return view('index');
}
}
Models (datatoPDF.php)
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class datatoPDF extends Model
{
protected $table = 'users';
}
Laravel 5.3 tutorial - How to export data from database into an Excel Spreadsheet or PDF Files in laravel 5.3?
Laravel Excel brings the power of PHPOffice's PHPExcel to Laravel 5 with a touch of the Laravel Magic. It includes features like: importing Excel and CSV to collections, exporting models, array's and views to Excel, importing batches of files and importing a file by a config file.
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use PDF; // pdf namespace
use Excel; // Excel namespace
use App\datatoPDF;
class PDFController extends Controller
{
// show all data
public function index(Request $req)
{
// show all data to index
$blogs = datatoPDF::all();
view()->share('blogs',$blogs);
// if request has pdf
if($req->has('downloadpdf')){
$pdf = PDF::loadView('pdf')->setPaper('a4', 'landscape');
return $pdf->download('pdf');
}
// if request has excel
if($req->has('downloadexcel')){
Excel::create('users', function($excel) use ($blogs) {
$excel->sheet('Sheet 1', function($sheet) use ($blogs) {
$sheet->fromArray($blogs);
});
})->export('xls');
}
// return index page
return view('index');
}
}
Models (datatoPDF.php)
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class datatoPDF extends Model
{
protected $table = 'users';
}