Questions tagged as 'laravel-4'

3
answers

I can not access the property of the object. Laravel / Eloquent ORM

I can not access the properties of the related object. Well, I have a class named FileClass , it has the following relationship with class FileServico : FileClass.php public function fileServico(){ return $this->has...
asked by 05.06.2014 / 18:59
1
answer

Insert array in bank with Laravel

I have a form that returns an array with the values: Número: {{Form::text('tel[]')}} Proprietário: {{Form::select('proprietario[]',['Aluno'=>'Aluno','Pai'=>'Pai'])}} Tipo: {{Form::select('tipo[]'['Pessoal'=>'Pessoal', 'Comercial'=>...
asked by 02.12.2015 / 13:03
1
answer

Pass route variable to controller method

I need to pass a variable from a route to a controller method. The route: Route::get('busca/{id}', 'MatriculasController@busca'); How can I pass the id variable to the method?     
asked by 03.11.2015 / 16:35
1
answer

Two conditions in SQL query with Laravel 4

I need to query MySQL with two conditions. I tried to do this: $query=DB::table('veteranos')->where('ra', '2300')->where('flag', 0)->pluck('ra'); In this way, the second condition is not working, that is, the query takes values oth...
asked by 21.12.2015 / 13:04
1
answer

Problem with subfolders and url rewrite with Laravel

I'm trying to make Laravel 4 run in a subdirectory, using .htaccess to be able to rewrite the url to the public folder Example: C:\xammp\htdocs\laravel4 .htaccess is rewriting C:\xammp\htdocs\laravel4 to C...
asked by 11.12.2014 / 17:46
1
answer

distant relationship with laravel

I have this table structure and would like to know if the person who posted the thread or the reply member or moderator in> but I could not structure a relationship that works, can anyone help me? forum id - integer name - s...
asked by 16.08.2014 / 23:02
3
answers

Return only the newest record of each author

I have a table with the following fields: id, texto, autor_id, data I need the records to be grouped by autor_id (because it has multiple texts with the same author) and I get the newest ones in ascending order only. I'm using Lavare...
asked by 16.03.2014 / 01:57
2
answers

Sort relationship "Many To Many" using as base field another table

I am doing a virtual store, to know better the framework Laravel, and I came across the following situation: I have a table called products to store the information related to the products. I also have a table named types to store the types o...
asked by 09.05.2014 / 17:46
2
answers

Date being recorded wrong in bank m-d-Y instead of Y-m-d

I set the date format for viewing to "d-m-Y", while the recording format is the "Y-m-d" bank. However at the time of recording in the bank, something happens and the data is going in the format "mdY", and with that the data will be truncated,...
asked by 22.12.2013 / 23:37
3
answers

Add variables to the session Auth laravel 4.2

I have my Auth session, which returns the user's data: print_r(Auth::user()); In this session, I want to add the company data associated with the user. In my User model, I added the following: public function empresa() { $this->b...
asked by 28.12.2016 / 13:34