Questions tagged as 'laravel'

1
answer

How to make mask for display of phone, cnpj, cpf, etc in Laravel

I'm new to Laravel and would like to display fields like CPF, CNPJ and Headphones formatted as (xx) xxxxx-xxxx, etc. I researched and found a function that would execute this (mask: link ) but I could not insert it.     
asked by 16.01.2017 / 19:59
1
answer

Multiply insert with laravel 5.3 dynamic form

I'm trying to make a multiple insert with Laravel 5.3 in a table as follows: Form {!! Form::open(['route' => 'demanda.store', 'class' => 'form']) !!} <div class="form-group form-inline"> {!! Form::label('ano',...
asked by 31.01.2017 / 21:22
3
answers

How to get only the month of a date with Laravel 5.3?

I need to get only the month of a date that comes with a $request . But I do not know how to do it: if ($request->parcelas > 1) { $mes = $request->data_vencimento = date('m'); for($i = 0; $i <= $request->pa...
asked by 21.11.2016 / 16:42
1
answer

ajax is not returning success in Laravel

Hello, I'm getting to know this framework now. I'm trying to send ajax via post and see if it returns something, but it did not work, follow the problem below: $("#modal-comentario").on("click", function(){ var get_id = $(this).data("...
asked by 14.09.2016 / 02:49
1
answer

Update multiple records at once laravel

Hello, I have a table with the following fields: KEY, VALUE , ALIAS, CLIENT_ID . In a given system process I need to update the Key and Value. To update the append a record I have no problems, the problem is that when I need to change t...
asked by 15.09.2016 / 19:37
1
answer

Is it possible to access multiple databases in the same Laravel 5 project?

The scenario is as follows: I have a web site that can be accessed by 5 different countries - > br.meusite.com , us.meusite.com , fr.meusite.com , .... All URLs point to the same folder inside the server - > www/m...
asked by 25.07.2016 / 01:38
1
answer

Laravel x Cakephp

I'm starting in Laravel (5.x), but I have years experience in Cakephp and would like to solve some doubts, since I did not find something like this on the Internet: 1) I can only create models, controllers and the like by the command of Artis...
asked by 31.07.2016 / 02:19
1
answer

What is the best way to query a user's data in Laravel?

When displaying multiple data from a user in a view, is it best to do it in a way? Option 1 (pass data to the view): $usuario = Auth::user(); return view('painel.usuarios.perfil', compact('usuario')); Option 2 (directly in the view): A...
asked by 07.11.2016 / 18:04
1
answer

Delete Directory Image - Laravel 5.1

I have the following code in my destroy method: try{ Tecnico::find($id_tecnico)->delete(); DB::commit(); return Redirect::back()->with('message', true); }catch (\Exception $e){ DB::rollback(); return $this->ren...
asked by 13.04.2016 / 20:48
2
answers

Array of unique values with foreach

I have the following foreach to get the id of the devices that were used in each sector: @foreach($relatorio->Empresa->SetorEmpresa as $setor) {{ $collection[] = $setor->SetorEmpresaEdificacao->id_aparelho_ruido }} @endfo...
asked by 11.05.2016 / 19:43