Questions tagged as 'laravel'

2
answers

How can I get a value between [] of a String?

When postgres sends an error, it sends a message with a code, example:    SQLSTATE [23505]: Unique violation: 7 ERROR: duplicate key violates uniqueness restriction «cargos_index_lower_unique»   DETAIL: The key already exists (lower (name ::...
asked by 08.11.2016 / 15:44
2
answers

Search previous and next record of the selected one in laravel 5.3 [closed]

How can I get the previous record and the one that follows from the selected record. example: I have the record 2 but I want me to find the 1 and the 3. How can I find it in eloquent?     
asked by 27.12.2016 / 19:11
2
answers

How can I modify a field to integrate and return it null or empty? from laravel in DB postgresql

The table is as follows: CREATE TABLE public.productos_procesos ( id integer NOT NULL DEFAULT nextval('productos_procesos_id_seq'::regclass), id_productos integer NOT NULL, id_procesos integer NOT NULL, unidad_teorica integer, id_uni...
asked by 15.03.2017 / 18:56
1
answer

Use variables outside of $ sheet-each () - Laravel Excel

I have a function that imports an Excel with the Laravel-Excel library, and within that function in the $ sheet-> every (function ($ row)) {} I am adding the records in an array that I have declared inside the function but outside the $ sheet-...
asked by 09.08.2016 / 11:32
2
answers

Compare variables in Blade [closed]

I need to make a comparison between 2 variables: Controller: $files = \File::files('images'); foreach ($files as $file) { $info[] = pathinfo($file); } $books = File::where('status', 1)->select('name')->get(); return view('catal...
asked by 15.07.2016 / 06:25
4
answers

Help with laravel 5.1

I'm starting to study laravel 5.1, I'm excited about this but when I create a controller (contactController) <?php namespace app\Http\Controllers; use app\Http\Controllers\Controller; class ContactoController extends Controlle...
asked by 18.07.2016 / 04:03
1
answer

I need to pass this query to laravel

I need to pass this query to laravel select p.name, e.date_hour, e.num_comprobante, SUM (d1.value * d1.quantity) as water, SUM (d2.value * d2.quantity) as holidays, SUM (d.value * d. quantity) as others, e.total_species from kind and jo...
asked by 02.01.2019 / 03:16
1
answer

Mark a radio button according to the value of the database

In a form I have a cycle that generates 3 radiobuttons and assigns the Id and the name they have in the database @foreach($type as $t) <div class="custom-control custom-radio"> {{Form::radio('incapacityType',$...
asked by 04.12.2018 / 22:21
1
answer

How to use with laravel 5.6 in two models and get your data

Hello, I have a table called ReserveTable and another table called Fields I want to get the data of the model of the court: public function reserva(){ return $this->belongsTo('App\ReservaTable','idcanchas', 'idcanchas'); } in my Cont...
asked by 05.12.2018 / 19:22
1
answer

Laravel form destination from Javascript

I have a form in a blade view, like this: <form id="delete_form" method="post" action=""> @method('DELETE') @csrf <input type="hidden" id="delete_type" name="delete_type" value=""> </form> The value of actio...
asked by 24.11.2018 / 13:54