Questions tagged as 'laravel'

2
answers

Convert the date format of an array with Laravel / PHP

How to convert index [date_start] to 2018-08-23 12:19 with php or laravel? Array ( [id_restaurant] => 303 [date_start] => 23/08/2018 12:19 [date_end] => 27/08/2018 12:19 )     
asked by 30.08.2018 / 19:16
1
answer

Problems while navigating json nested

I have a response in json I have a problem with going through it, the first is that I can only get a part of json and not the value I want , the second thing that I get from the first one is not going through the response number it gives...
asked by 03.08.2018 / 18:15
2
answers

Get last grouped MySql record per year

I have the following table I need to return only the last record of the teaching step sorted by year_level, using Laravel / MySql Example: 2002 - 15 / 2004 - 16 I'm trying: $carga_horaria = DB::select(DB::raw('ch.*')) ->f...
asked by 17.08.2018 / 16:03
3
answers

Test of variable true or false

I have a controller that I may or may not receive a request If I receive it I will use it It turns out that it is always entering the condition, even when it is false I'm testing a true or false value What's wrong? $turmas_todas = isset...
asked by 19.07.2018 / 16:22
1
answer

Laravel - does not record price when value is NULL

I have a Laravel mutator to handle a field, but if the field is empty it does not save the default value in the database. MODEL /// PROMOÇÃO TROCA VIRGULA POR PONTO public function setPromocaoAttribute($value) { $value==null ? '0.00'...
asked by 26.07.2018 / 15:07
1
answer

Variable returns NULL - Trying to get property of non-object

I'm using laravel 5.6 along with the AdminLTE . When I login, it is returning the error    ErrorException (E_ERROR)   Trying to get property of non-object Displaying the page.blade.php view, in the <div class="pull-left info text...
asked by 29.06.2018 / 15:20
2
answers

Create template for routes in Laravel with resource

I would like to know how to create a template on the blade containing the generic actions (view, edit, delete) for all the routes of my application, for example in the actions column I have the code: <td> <!-- botão Exibir -->...
asked by 15.06.2018 / 22:43
1
answer

php method that checks two strings in a variable

Does anyone know of any method in PHP that equals the value of a variable with string ? I need to refactor the following code: public function hasPlan() : bool { return $this->reference === 'unico' || $this->reference === 'simult...
asked by 25.06.2018 / 15:36
2
answers

Controller method getting wrong value in Laravel

A piece of my application consists of the client login and from there to register some pertinent information daily. When logging in, it falls on the screen to choose in which capture it will register the data. In the next one he chooses which ca...
asked by 20.06.2018 / 17:05
3
answers

Doubt Passing Array Laravel Routes

The question is as follows, in my PDF generator, when I click generate, it generates a pdf with all the information that is contained in the database tables, so I am in doubt how to only pass the array, which is found when a search is done. E...
asked by 24.07.2018 / 15:02