Questions tagged as 'laravel'

1
answer

Consultations with laravel

I recently started with laravel and I have a terrible doubt. I've done several google searches that only left me more confused yet. I have a news table and a photo table. Each news item has several photos. In home you have to see the last two...
asked by 05.07.2017 / 14:53
2
answers

Problems with HTTPS and WWW Redirection

I'm having trouble with one thing, I have several conditions to answer in my .htaccess but I can never answer them at once, just one or the other. I have a project in Laravel in the path /public_html/portal/ to display need to redirect...
asked by 03.05.2017 / 13:37
1
answer

Check route with variable in Laravel 5.1

I'm using the code below to assign the "active" class when on the "product" or "product / create" route. <li {!! Request::is('produto', 'produto/create')? 'class="active"' : null !!}> Now I need to do the same in the product edition,...
asked by 08.05.2017 / 16:29
1
answer

Laravel - How to call a different action from store, update, edit?

I created a action but not the default of resource , as I can call it by an action in form as I call update and store . <form method="POST" role="form" action="{!!URL::route('cadastro.store')!!}" > I w...
asked by 02.12.2016 / 00:16
1
answer

LEFT JOIN with AND at Eloquent Laravel 5

I have a query with Left Join with AND I am not able to implement this in laravel 5. An excerpt from the query: LEFT JOIN visitante v ON a.codigo = v.id AND v.data BETWEEN '2015-06-01' and '2016-05-31' and v.status = '1' I tried this wa...
asked by 25.11.2016 / 15:38
2
answers

Popular select with database values

I need a popular select on form with values from another table. Type: <select> <option value="29">Frentista</option> </select> I wrote my select like this: {{ Form::select('set_id_fk', $setores, null, ['class'=&...
asked by 22.11.2016 / 20:16
1
answer

How to get the result of the query executed in Eloquent?

How do I get the result of query that will be executed in the database? Example: foreach ($prestadores as $prestador){ $achou = \DB::table('modulo_pr_espelho') ->where('prestador_id','=', $prestador->id)...
asked by 14.11.2016 / 21:44
3
answers

belongsToMany Laravel - find ()

I'm developing an Intranet that will span Categories and Posts . A post can receive "n" categories. For this purpose I am using belongsToMany () . The problem is when returning this data with Post :: find ($ idpost) , it returns not o...
asked by 19.08.2016 / 13:41
1
answer

Sorting data with php

I need to sort an array by a specific "order" field, where within that array I have banners with the id, order, name, and img fields. I need to sort this array in order. the 0 order banner needs to come first, 1 second, and so on.     
asked by 21.09.2016 / 20:19
1
answer

Self-relationship with Eloquent in Laravel 5.3 [duplicate]

I am building an immigrant control application and own an imigrants table that has 3 auto relationships. Its structure is as follows. id - > pk first_name - > varchar last_name - > varchar (...) father - > integer (fk)...
asked by 26.12.2016 / 17:45