43 lines
1.2 KiB
PHP
43 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Account;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\View;
|
|
use App\View\Composers\ProfileComposer;
|
|
use Laravel\Sanctum\PersonalAccessToken;
|
|
|
|
class ExportController extends Controller
|
|
{
|
|
public function exportAccount($hashedTooken){
|
|
$token = PersonalAccessToken::findToken($hashedTooken);
|
|
$user = $token->tokenable;
|
|
$account = $user->account()->with('profile')->first();
|
|
//dd(json_decode($account->bank));
|
|
|
|
$headers = array(
|
|
"Content-type"=>"text/html",
|
|
"Content-Disposition"=>"attachment;Filename=Sowalnama.doc"
|
|
);
|
|
|
|
$content = view('oprosniki.'.$account->type, ['account' => $account])->render();
|
|
return \Response::make($content,200, $headers);
|
|
}
|
|
|
|
public function export($id){
|
|
$account = Account::with('profile')->find($id);
|
|
//dd(json_decode($account->bank));
|
|
|
|
$headers = array(
|
|
"Content-type"=>"text/html",
|
|
"Content-Disposition"=>"attachment;Filename=Sowalnama.doc"
|
|
);
|
|
|
|
$content = view('oprosniki.'.$account->type, ['account' => $account])->render();
|
|
return \Response::make($content,200, $headers);
|
|
}
|
|
|
|
|
|
}
|