Questions tagged as 'laravel'

1
answer

Bring Existing and Non-Existing Records

I have the following scene: $consulta = Dealer::find(1); No Model # Serviços public function dealer_servicos(){ return $this->hasMany('App\DealerService', 'id_concessionaria'); } Then if I do: @foreach($consulta->dealer...
asked by 25.05.2016 / 14:16
1
answer

Folder for Models Laravel 5.1

Good morning, other than Laravel 4 , the 5.1 version creates the Models directly in the App folder, I wanted to know if it will influence something if I create folders to better organize those Models .     
asked by 07.01.2016 / 14:45
2
answers

(Laravel) method $ .get can not find route

Hey guys, all right? I would really appreciate your help as I have been stuck with this problem for a couple of days and can not solve it myself. I have a multi-line table with a checkbox on each line and a button that, when clicked, takes...
asked by 16.02.2016 / 18:45
1
answer

Difficulties in Creating Routes and Controller Laravel 5.1

I created a CRUD with Modal is working everything right but I created form request data view, queries with BD all inside Routes, I do not think very cool would like to pass these features to the Controller to do but is not working is appearing t...
asked by 11.04.2016 / 22:01
1
answer

Save multiple images in a php loop

Personal I have the code below in Laravel that saves a single image and works correctly. But I would like to save multiple images that come from an input that looks like name: "name []" multiple. I think I would need a for but I could not get it...
asked by 01.05.2017 / 17:18
1
answer

How to add my validation in Laravel Validator?

In% with both 4 and 5, we have class Laravel , which allows specific validations. By default there are several, such as Validator , required , email , and others. But I would also like to be able to validate a phon...
asked by 10.03.2016 / 17:21
1
answer

Laravel validation

I need to do a validation of data coming from an XML, how can I use a Validation Request ? Or Validation Request only serves data coming from a form?     
asked by 26.05.2015 / 02:46
3
answers

Call class constructor

Actually, this way, is it really wrong? I'm not really understanding the typing: class FinanceiroController extends Controller { /** * @var ChamadosFinanceirosRepository */ private $chamadosFinanceirosRepository; /**...
asked by 25.08.2015 / 17:26
2
answers

What is the convention regarding the location of queries in Laravel 4?

My question is about the following: public function getIndex() { $users = \User::all(); return \View::make('admin.users.index') ->with('title', 'Usuários') ->with('users', $users); } In this case I called the all()...
asked by 09.05.2014 / 20:08
2
answers

Return array of properties in laravel

I created a function in the controller that returns me the users where the user_anjo condition is equal to 1. You are currently returning all of this user's data in json. How can I do to return only the user's emails? I tried something...
asked by 22.12.2018 / 15:04