Questions tagged as 'laravel'

1
answer

Laravel - List with relation of tables (state / city = person)

I have the following tables: contacts = > id - name - state - city states = > id - status - acronym cities = > id - city - state_id And the following templates: State.php <?php namespace App; use Illuminate...
asked by 03.05.2016 / 01:13
1
answer

How to make a "select distinct" in a model in Laravel?

I'm pulling data from a table to a select , however I have fields where information is the same, for example: Controller: $amostragens = Amostragem::all(); View: @foreach($amostragens as $amostragem) <option value="{{...
asked by 02.05.2016 / 21:22
1
answer

Laravel - Search if there is a relationship in the many-to-many table

I need to search for users based on some filter attributes. I have the contacts table: id | nome | email 1 | asd | [email protected] 2 |teste | [email protected] The groups table: id | grupo 1 | grupo1 2 | grupo2 And the table c...
asked by 10.05.2016 / 22:24
1
answer

How to customize the Laravel 4 error page?

When an error occurs in Laravel 4 , with the setting of app.debug equal to false , the following page is returned: In this case, for both% and% errors, this page is displayed. Is there any way to change the page th...
asked by 24.02.2016 / 15:07
1
answer

Sorting the results of a query - Laravel 5.1

I currently have a code that receives data from the registered companies and for each company it lists the reports of them as follows: @foreach($empresas as $empresa) // Recebe as empresas @foreach($empresa->CgrtInfo as $relatorio) // Bu...
asked by 29.01.2016 / 13:53
1
answer

Relationship Eloquent do Laravel

I have 3 tables: -- tipos id nome -- usuarios id tipo_id nome email -- atividades id usuario_id descricao I'm using Eloquent to capture activity and user data from the activity: $results = Atividades::with('Usuario')->get(); But I...
asked by 13.01.2016 / 21:48
1
answer

Creating and using Libraries in Laravel 5.1

I'm new to Laravel 5.1 (I come from CodeIgniter) and I have libraries of my own that I'd like to implement in it. In CodeIgniter, we have the folder libraries where I can play all my libraries there and if in case I need the same just nee...
asked by 30.12.2015 / 12:05
1
answer

Single record with 2 fields verification - Laravel 5.1

I have a table with columns id , nome , descricao and tipo . In my Request I have: 'nome' => 'required|unique:edificacoes' So far so good, I can not register anything with the same name, but how would I n...
asked by 08.01.2016 / 18:00
1
answer

Route Error When Accessing Site

When I add this route in the routes.php file: routes.php Route::get('postagem', function (){ return "teste"; }); Route::get('/', function(){ return View::make('hello'); }); Displays this error:    Fatal error: Class 'Route'...
asked by 10.11.2015 / 16:18
1
answer

Condition To Rotate Function __Construct

I created a __construct function in the Controller.php of Laravel 5. And this function is obviously running even on the Login screen in Auth . Is there any way I can put as a condition, run the function inside __construct...
asked by 24.11.2015 / 11:23