Questions tagged as 'laravel'

1
answer

Laravel - Relationship ManyToMany extra columns

I have the following scenario in a database: Tables: User id, name email Company id name UserCompany userid business_id start_date data_termino In this scenario, I need to bring the information...
asked by 16.08.2017 / 18:32
1
answer

Compile multiple JS retaining the original names

Personal I have a folder inside the resources called js where it has several JS files and subfolders with other JSs. How do I set up Laravel Mix for it to compile all the contents of the JS folder including the subfolders into the public / js fo...
asked by 27.03.2018 / 03:58
2
answers

Pass string to uppercase - laravel

Good afternoon. I have the following code that perfectly saves. public function store(Request $request) { $this->validate($request, [ 'servidor' => 'required|unique:servidors|max:255', // 'dtprotocolo' => 'date|date...
asked by 08.11.2017 / 19:25
1
answer

Error trying to migrate bd from Laravel to PostgreSQL

I'm using PostgreSQL "5.4. *" Using MySQL, after php artisan migrate ok. But now I need to use PostgreSQL in the project, but after changing the DB: DB_CONNECTION=pgsql DB_HOST=127.0.0.1 DB_PORT=5432 DB_DATABASE=laravel-api DB_USE...
asked by 17.10.2017 / 20:25
2
answers

Laravel / Eloquent - Undefined variable: idRequest

I have two queries looking at the model. The first one is working normally: $pedidos = Pedido:: orwhere(function($query){ $query->where('user_id', $_SESSION['idUsuario'])...
asked by 20.10.2017 / 19:27
3
answers

Excel rounding value 7,256E + 18

That old doubt with Excel cell formatting is causing me problems now. I use laravel framework and to export the data I use Laravel Excel . I am formatting the cell for text type and even then Excel continues rounding the values and changing...
asked by 28.09.2017 / 13:35
1
answer

Optimize queries with leftJoin Laravel?

I have linked tables and when I need to access the information I recuse the query : DB::table('paciente AS pac') ->leftJoin('pessoa AS p', 'p.id', '=', 'pac.id_pessoa') ->select('p.nome, pac.ficha') ->where('pa...
asked by 26.05.2017 / 16:26
1
answer

Problem with search and pagination in Laravel?

The code below returns all the records of the database and also searches for the term typed in input of search with pagination. The problem is that by clicking for example on page 2 it already refreshes the page returning all the recor...
asked by 25.05.2017 / 22:50
1
answer

Blade in Laravel 5.4 - How to work with class="active" in the menu links of a page in this scenario?

I have a menu with 3 possibilities: pg1, pg2 or pg3. The page is generated in Blade using bootstrap. <a href="#" class="active">pg1</a> <a href="#">pg2</a> <a href="#">pg3</a> I would have to identify in...
asked by 14.03.2017 / 19:46
1
answer

Doubt Laravel SQL Queries?

I'm starting with SQL of Laravel I looked a lot more I did not get a response of how to AND after where , follow sample code to implement AND . SQL: UPDATE contas SET valor_titulo = 0, WHERE id_contrato = 2...
asked by 22.03.2017 / 20:41