Questions tagged as 'laravel'

1
answer

Select2 with ajax not returning data

I'm trying to make an ajax query to an api to dynamically create a select2. The api is returning data normally, but only the "No results found" message appears in the select. HTML <select name='produtos[]' multiple="multiple" id="selP...
asked by 05.04.2018 / 11:17
1
answer

coupon-style PDF

I need to create a PDF-style coupon to send to a non-fiscal Daruma DR800 printer. I need to know how to generate a custom size PDF and its contents. I already do PDF generation with DOMPDF in Laravel 5.5. Example of how to generate any PDF...
asked by 05.04.2018 / 16:45
2
answers

Retrieving multiple items in a relationship - Laravel

I'm having a little problem, I have a course and student relationship in the system. I created a show function in the controller and wanted to make clicking on the details show all students enrolled in a course. show on CourseController pub...
asked by 26.03.2018 / 20:36
1
answer

How to show validation message below a group of radio buttons?

For the problem below consider that I'm using Laravel (5.6 * with style files and default javascript (no changes). My problem is basically when trying to display the validation message of the radio (id: gender) field group, these are groupe...
asked by 14.03.2018 / 20:16
1
answer

Error working with date format in Laravel

I'm having a hard time manipulating an input of type date . When using this type of input the date is formatted as Y-m-d, however, in my form I want to type dd / mm / yyyy. Model User: //... protected $dates = [ 'data_nascimento' ];...
asked by 15.03.2018 / 05:55
1
answer

How can I create a custom method in the Laravel model and match the result of another?

I'm working with Laravel and have created the following method to do research on a model: public function search($string) { return (strlen($string) > 0) ? $this->where('name', 'like', '%' . $string . '%') : $this; } I use it as fo...
asked by 29.03.2018 / 14:39
2
answers

How can I handle constraint violation exception to show user friendly

What is the best way to treat an Integrity constraint violation exception to explain user friendly?     
asked by 11.06.2016 / 17:10
1
answer

Laravel 5.5 link with Ancora

I have the route below that redirects to the main page of my site .. Route::group(['prefix' =>'site', 'namespace' => 'site'], function(){ Route::get('/', 'SiteController@index')->name('site'); I wanted to add an anchor to the...
asked by 23.02.2018 / 18:06
1
answer

How to use emit and computed / watch

I'm new to VueJS and started to develop a project to study a time release and time worked spreadsheet. I'm using the Laravel 5.5 project with Vuejs 2 and MomentJS to calculate the differences. But I could not figure out how to use the emit...
asked by 22.02.2018 / 03:19
1
answer

Doubt with Laravel MVC

I made the presentation to the pfc teacher but she said that I broke the mvc pattern, calling the sql in the controller, and requested that I send it to the model and retrieve the query for the controller and send the email. But how can I get...
asked by 22.06.2018 / 17:36