https://laravel-news.com/eloquent-tips-tricks
/**
* @param Request $request
* @param integer $bankId
* @param datetime $from
* @return \Illuminate\Http\JsonResponse
*/
public function getBankFilesUploadedFromMonth(Request $request, $bankId = null)
{
$fromMonth = $request->get('fromMonth', '01');
$fromYear = $request->get('fromYear', date('Y'));
$account = $request->get('user');
try {
if (!$account->isAdmin())
$bank = $account->bank;
else
$bank = $this->bankRepository->find($bankId, true);
} catch (\Exception $e) {
Log::error($e->getMessage());
}
/** @var \Infos\Banks\Models\BankModel $bank */
if ($bank->isDeleted)
abort(Response::HTTP_BAD_REQUEST);
return response()->dataJson($this->dataRepository->getFilesUploaded($bank, [
'isDeleted' => config('fileUpload.isNotDeleted'),
'isInUse' => config('fileUpload.isInUse'),
'isPriorYearData' => false,
['forMonth', '>=', $fromMonth],
['forYear', '>=', $fromYear],
]));
}
https://ourcodeworld.com/articles/read/226/top-5-best-open-source-pdf-generation-libraries-for-ph
Wkhtml (Snappy) a lib from KNP (Symfony) seem have most reputation.
Wkhtmltopdf Ubuntu have some problem with css.
Be careful with Snappy HTML content load css, js URL.
On Dev environment for example we should point full URL to assets (css, js) in order to make it work as expected.
For example, your API server is Linux but FE is Angular2, so double check assets URL in blade.
/**
* @param Request $request
* @param integer $bankId
* @param datetime $from
* @return \Illuminate\Http\JsonResponse
*/
public function getBankFilesUploadedFromMonth(Request $request, $bankId = null)
{
$fromMonth = $request->get('fromMonth', '01');
$fromYear = $request->get('fromYear', date('Y'));
$account = $request->get('user');
try {
if (!$account->isAdmin())
$bank = $account->bank;
else
$bank = $this->bankRepository->find($bankId, true);
} catch (\Exception $e) {
Log::error($e->getMessage());
}
/** @var \Infos\Banks\Models\BankModel $bank */
if ($bank->isDeleted)
abort(Response::HTTP_BAD_REQUEST);
return response()->dataJson($this->dataRepository->getFilesUploaded($bank, [
'isDeleted' => config('fileUpload.isNotDeleted'),
'isInUse' => config('fileUpload.isInUse'),
'isPriorYearData' => false,
['forMonth', '>=', $fromMonth],
['forYear', '>=', $fromYear],
]));
}
https://ourcodeworld.com/articles/read/226/top-5-best-open-source-pdf-generation-libraries-for-ph
Wkhtml (Snappy) a lib from KNP (Symfony) seem have most reputation.
Wkhtmltopdf Ubuntu have some problem with css.
Be careful with Snappy HTML content load css, js URL.
On Dev environment for example we should point full URL to assets (css, js) in order to make it work as expected.
For example, your API server is Linux but FE is Angular2, so double check assets URL in blade.
Comments
Post a Comment