I would like to know how to create a function that validates the parameter received from a route in Laravel , for example, has a route:
Route::get('fotos/{user_id}');
where users can only access where user_id is equal to the id...
I'm trying to register a user on the table and is returning the following error:
SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES) (SQL: select count(*) as aggregate from users where...
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...
I'm uploading images to the folder storage , app/public , inside this I created a /banners folder and I'm uploading those images into this folder.
How can I get these images and display them in the view?
I make use of Laravel 5.3.
I have a variable that returns this value in a var_dump ():
array(3) {
[1]=>
string(5) "10:00"
[2]=>
string(5) "10:20"
[3]=>
string(5) "11:40"
}
But if I give:
@foreach($variavel as $val...
I created this function in my Controller to return a list of employees in my ajax request, but it is not returning anything.
public function getFuncionarios(Request $request){
if($info = Funcionario::where('id_empresa', $request->get('e...
I just faced a problem in Laravel 5.1 .
Imagine that I have the following:
Model
class User extends Model{
# Mutator
public function getNomeUpperAttribute(){
return strtoupper($this->attributes['nome']);
}
}
Con...