Questions tagged as 'laravel-5'

2
answers

Url Ajax request pointing to a laravel route

I configured the following route in my route file: Route::post('order/productsByCategory', ['uses'=>'OrderController@productsByCategory']); How do I use it in my Ajax request? $.ajax({ url: "", type: 'POST', dat...
asked by 27.03.2017 / 03:45
1
answer

Migration on multiple tables with the same prefix

Is it possible with laravel to generate a migration that changes multiple tables with the same prefix? for example: in tables pesquisas_187 and pesquisas_146 (tables that have the same fields) Schema::table('pesquisas_', function...
asked by 02.03.2017 / 20:31
1
answer

How to check if an array has an attribute?

I'm using Laravel 5.4 in an application, and a validator method gets an array . This array can have the attributes: [ 'nome' => $request->nome, 'ddd' => $request->ddd, 'fone' => $request->fone ] Or jus...
asked by 16.02.2017 / 16:08
1
answer

Create aliases for columns in a table in Laravel

Is it possible to create aliases for the column names of a table in Laravel's Model? Example: I have a questao table with columns: id questao disciplinas_id serie_id professor_id It would be simpler if I could treat the columns by ot...
asked by 23.06.2017 / 13:13
1
answer

How to create an array dynamically in PHP?

I need to create an array in the format: //$arr = ['id' => 1, 'razao_social' => 'Teste'] // saida esperada // iteração foreach($prestadores as $prestador){ // logica separando apenas alguns prestadores if ($cont($outro_sql) >...
asked by 14.11.2016 / 22:40
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

Creating the bank with laravel migration

I know that with migration I can create the tables, but have some way to automate even the creation of the bank with migration to follow as base I use Laravel 5.2     
asked by 23.11.2016 / 00:46
2
answers

Count lines laravel

I'm using Laravel 5.2 and I have a lot of doubts to tell the lines about my search. I need to return the number of products within Categorias and SubCategorias . My relationships are as follows, in the Product table I have...
asked by 17.10.2016 / 16:54
1
answer

Problems writing to an input from the controller

Hello, I'm having trouble inserting the data from the controller. I am doing the activities of a House of Code Laravel book to learn and I needed to do this to update the registry of a tuple from the bank, I ended up using the following worka...
asked by 06.09.2016 / 18:31