I have a list of users, each user has their 'role' (role / function inside the system, such as 'user' and 'admin') and this role has to be shown in the users list screen, which I I did it using the code block below.
@foreach ($users as $key =&...
Expensive,
Can you help me with this laravel redirect?
I created a method where it re-evaluates the data and redirects, on the other hand at the time of redirect I get the error Route [climate.consensus.visual.ID] not defined, only that I def...
The system I'm servicing has CPFs registered in two ways, with and without punctuation, due to poor start-up that did not impose a standard. The problem is that the CPF can not be repeated, and when the user types a CPF with no punctuation, if i...
Of a question, I was given a way to query with child objects using the Join of eloquent, The query is below:
$dados = Roda::join('veiculos', function($query) {
$query->on('veiculos.id', '=', 'rodas.veiculo_id');
$query->where('ve...
I'm trying to run a query in Laravel , the terminal works perfectly, but when I enter in Laravel , it returns me empty, eg:
Query:
SELECT
MAX(positions.id),
devices.name,
positions.deviceid,
positions.ser...
I need to make an appointment at the bank to see the birthday of the current month. Such a query, see:
SELECT * FROM membros WHERE day(dataNasc) = day(CURRENT_DATE) and month(dataNasc) = month(CURRENT_DATE);
How could I make thi...
Good afternoon, I'm starting with studies in laravel, the moment I joined Eloquent ORM I began to have problems.
This is my controller.
<?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\DB;
use estoque\Produto;
use Reque...
I'm studying Laravel and I'm not able to how to join and display the data. All students who are in a class with the names, class code and description of the final situation.
Model: TurmasHasEstudantes
public funct...
I have 3 tables that you need to join to access the information. By the relation of Laravel I can create simple relations, such as belongsTo .
I'm trying to access the information from the first table with the id of the thi...
I have a relationship of User with Role .
User::with('role')->get()
In this case, User has the columns: id , name, role_id , created_at and updated_at .
And Role has: id , name...