laravel-5.8

Using @error directive to target the previous input field from multiple input fields after submit in Laravel 5.8

隐身守侯 提交于 2021-02-17 06:46:24
问题 The new @error directive was introduced in Laravel 5.8.13. So, instead of doing this: // old @if ($errors->has('email')) <span>{{ $errors->first('email') }}</span> @endif You can now do this // new @error('email') <span>{{ $message }}</span> @enderror However, I'm having issues trying to target only the input fields where the error was made among several similar input fields. These fields are similar because they have the same name. But they are also in seperate forms and have different

Using Laravel 5.8 authentication with external JSON API (Creating own ServiceProvider)

不想你离开。 提交于 2021-02-16 15:09:46
问题 I'm building a Laravel 5.8 application to be the front-end to an external API written in Go. I POST a user/pass to the API which then responds with either HTTP/200 and a JSON Token (JWT) or an HTTP/401 to signal the credentials are invalid. I would like to use Laravel's built-in auth mechanism (or anything which makes this work really) to be able to create pages and routes only for logged in users. It seems a lot of work to reinvent the wheel. [TLDR] Basically I need some code which checks if

PayPal REST API not returning recurring payment information in laraval

六眼飞鱼酱① 提交于 2021-01-29 09:56:18
问题 I am working on Paypal webhook (subscription) section to insert recurring payment information into the database. I have done coding based on the link "https://jslim.net/blog/2018/01/22/PayPal-Rest-API-with-Laravel-5-and-Angular/" but Paypal webhook always return “payment_status: Pending” on sandbox image and its not inserting recurring payment information into the database (insert option added in PayPalController - function webhooksPaymentSaleCompleted ). I think the problems related with

Resource Controller methods with model as parameter not working

两盒软妹~` 提交于 2021-01-29 05:56:46
问题 As in the basic Laracasts.com tutorial (Laracast 5.7 from scratch) I'm trying to use the following methods public function show(prototypes $prototypes) parameter to construct a view. However my view is created correctly but $prototypes is null. The route works well( /prototypes/1/edit ) and I ensured that a prototype object with the id 1 exists. I found some older solution which stated to use something like (integer $id) as parameter but this leads to some more code. It should work like this:

Printing preview doesn't working laravel-dompdf

放肆的年华 提交于 2021-01-29 00:03:30
问题 I'm developing an aplication to manage multiples branches for a fast food locale, it's up in a shared hosting, and trying to use barryvdh/laravel-dompdf library to print in a thermal printer (client side) two tickets (one for invoice and other for order). The idea is when the invoice is registered, then show the options to print the two tickets. But right now the web print preview doesn't show, only register the invoice and log show this error 'PrinterController::pdf Invalid characters passed

Printing preview doesn't working laravel-dompdf

烈酒焚心 提交于 2021-01-28 23:56:02
问题 I'm developing an aplication to manage multiples branches for a fast food locale, it's up in a shared hosting, and trying to use barryvdh/laravel-dompdf library to print in a thermal printer (client side) two tickets (one for invoice and other for order). The idea is when the invoice is registered, then show the options to print the two tickets. But right now the web print preview doesn't show, only register the invoice and log show this error 'PrinterController::pdf Invalid characters passed

shows define('LARAVEL_START', microtime(true)) - when i migrate php version to 7.3

半世苍凉 提交于 2021-01-28 05:09:34
问题 I got following Message(Access Home Page of Applications) when I update my Development Environment to PHP 7.3 */ define('LARAVEL_START', microtime(true)); /* |-------------------------------------------------------------------------- | Turn On The Lights |-------------------------------------------------------------------------- | | We need to illuminate PHP development, so let us turn on the lights. | This bootstraps the framework and gets it ready for use, then it | will load up this

laravel nova hide edit button on index page

橙三吉。 提交于 2021-01-05 09:57:12
问题 How to disable edit/delete button on nova index page and still allow in detail page, if I will create a policy, that will disable the operation everywhere, I want to allow edit and delete in detail page, but just want to remove those button from index, is doing something like public function update(User $user, Customer $customer) { if ( request()->route()->getName('route-name') ) { return false; } } is correct way or there is any better way? 回答1: I had a resource of Leads and I needed to hide

Laravel: How to get SUM of a relation column using Eloquent

旧时模样 提交于 2021-01-04 06:55:06
问题 How to get SUM on related model using eager loading, without loading whole relation data? In my project there are two models, Account and Transaction . Account model has many transactions. My requirement is : Get accounts and eager load only the sum on the related table . My current code is provided : In this code transactions are eager loaded and sum is calculated using php. But I would prefer not to load the whole transactions. The only requirement is sum('amount') . table : accounts | id |

Laravel 5.8 custom command not found

别说谁变了你拦得住时间么 提交于 2020-12-15 11:47:23
问题 I have created a custom command using artisan: php artisan make:command resetNegotiations Than deleted cache with: php artisan cache:clear But if I try to run: php artisan ResetNegotiations I got the error: Command "ResetNegotiations" is not defined. The file ResetNegotiations.php exists in app/Console/Commands I have found similar questions: - Command is not defined exception but it not fixed mine. I have updated the kernel as https://laravel.com/docs/5.8/artisan#registering-commands in app