Questions tagged as 'laravel'

1
answer

How to check route parameters in Laravel and only accept specific parameters?

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...
asked by 31.03.2017 / 15:05
1
answer

User registry Laravel 5.4?

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...
asked by 11.04.2017 / 15:42
1
answer

Class not found Laravel

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...
asked by 12.03.2017 / 21:55
1
answer

How to do inner join with Laravel?

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...
asked by 25.03.2018 / 21:46
1
answer

How to create a relationship between 3 tables Laravel?

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...
asked by 03.06.2017 / 14:27
2
answers

Specify columns in a relationship with Laravel

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...
asked by 27.01.2017 / 10:18
2
answers

Catch image inside storage folder

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?     
asked by 02.12.2016 / 22:57
1
answer

Laravel Blade prints unknown values

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...
asked by 09.02.2017 / 15:39
2
answers

How to return a collection of objects in laravel via ajax?

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...
asked by 01.08.2016 / 15:28
1
answer

Is it mandatory to go through Mutator / Accessor?

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...
asked by 14.10.2016 / 16:24