verumconsilium / laravel-browsershot

Browsershot wrapper for Laravel 5
MIT License
110 stars 19 forks source link

"Method VerumConsilium\Browsershot\PDF::SetTitle() does not exists" #6

Closed jasonxsiervo closed 6 years ago

jasonxsiervo commented 6 years ago

Laravel: 5.6.38 Voyager: v1.0.11 PHP: 7.2.2 Database: Mysql 10.1.30

I've been trying to integrate browser-shot into laravel voyager and I really don't know how I would do this. I have little knowledge about facades, node.js and puppeteer. As of now, I've successfully downloaded browsershot to my laravel project, using composer require verumconsilium/laravel-browsershot.

I've also installed puppeteer in my project folder using npm install puppeteer. In my Controller, Here are some of the contents of my Controller:

<?php

namespace App\Http\Controllers\Voyager;

use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use TCG\Voyager\Database\Schema\SchemaManager; use TCG\Voyager\Events\BreadDataAdded; use TCG\Voyager\Events\BreadDataDeleted; use TCG\Voyager\Events\BreadDataUpdated; use TCG\Voyager\Events\BreadImagesDeleted; use TCG\Voyager\Facades\Voyager; use TCG\Voyager\Http\Controllers\Traits\BreadRelationshipParser; use TCG\Voyager\Http\Controllers\VoyagerBaseController; use App\Tenant; use App\Room; use App\BillHistory; use App\BillingCategory; use View;

class TenantsController extends VoyagerBaseController { use BreadRelationshipParser;

public function downloadPDF($id) { $data = BillHistory::find($id);

    return PDF::loadView('pdf', $data)
        ->margins(20, 0, 0, 20)
        ->download();
}

... } ?>

I've also downloaded the files from this repository to my project folder(but not all). What am I missing?

P.S. I am deeply sorry for those inconvenienced by my little knowledge about this things. Please understand me.

sgtpepper9907 commented 6 years ago

Hi, the package doesn't provide a SetTitle method. If you want to set the title that is displayed in the browser tab, simply put a <title> tag inside the <head> in your html.

I'm closing this issue since it's not really a problem with the package but feel free to keep commenting if you face any more issues