Most voted "laravel-4" questions
Laravel is an open-source framework for developing web applications and services with PHP. Use this tag for specific questions about Laravel 4.
Learn more…141 questions
Sort by count of
-
21
votes2
answers14288
viewsHow to disable a text field for editing using jQuery/Javascript?
Let’s say I have a form with fields 1 to 7. Something like: field-1 field-2 field-3 field-4 field-5 field-6 field-7 All these fields are in one form. With Laravel, sometimes I experienced situations…
-
16
votes3
answers5592
viewsWhere to create a class of its own, and how to instantiate it later?
I have a class of my own (i.e. external to the standard PHP and Laravel libraries) that makes some connections with equipment in my network and also need to create routines for email and SMS…
-
9
votes3
answers995
views -
9
votes2
answers952
viewsAuthentication with two different tables
I need to do two authentications, one for clients another for administrators, so I have to have two instance of auth; how to do this in Laravel, where I have a client table and another for…
-
8
votes2
answers650
viewsHow to use Packages in Laravel 4?
I am new to the Laravel 4 framework. In Laravel 3 it was simple to use Bundles. In version 4 the use of the Bundles was removed and started to use Packages, but I didn’t understand how it is used,…
-
8
votes5
answers1837
viewsHow to create a configuration file in Laravel 4?
I would like to know how to create, import and use new configuration files in an Laravel 4 project. By that, I mean, project files and own settings. For example: I would like to create a file that…
-
8
votes2
answers927
viewsHow to log only active users?
In authentication beyond the data needed to log in the user, I want only those who are in status ativo = 1 log in, but I don’t know how to do this check. table user: id username email password ativo…
-
8
votes3
answers4784
viewsWhy Laravel instead of Yii?
It’s been a while since I actually developed in PHP. In my last research, about two years ago, I didn’t hear much about the Laravel, as long as the Yii led some rankings (including my) framework to…
-
8
votes2
answers476
viewsHow to change the method of an HTTP request in Laravel 4
I need to perform CRUD operations in certain locations of my application that are contained within other Formulars. For this I will use AJAX to update the views containing the "sub-content'. I’m…
-
8
votes1
answer152
viewsLibrary for data validations in Brazilian Portuguese for Laravel
Whenever I need to use cpf or telefone in Laravel, I need to use the method Validator::extend to add these validations. Validator::extend('cpf_real', function($attr, $value) { $c =…
-
7
votes2
answers744
viewsHow to create a Grouped List in Laravel 4 from an entity with self-relationship
I’m trying to create a select box com \Form::select() (grouped list) in Laravel 4 and I have the following entity: Items id = id do item nome = nome do item pai = fk dessa mesma entidade I already…
-
7
votes2
answers2551
viewsProblem with @extends in view on Laravel.
I have a problem with @extends('layouts.template'). Only my view that is as index that does not show the page, instead shows me only this @extends('layouts.template') on the page. What could be?…
-
6
votes6
answers1001
viewsError installing Composer in Laravel 4 Project
I’m starting out in the Laravel world and I’m having a problem spinning the composer install in the project. Running the command shows the following error: D:\htdocs\cpi2>composer install Loading…
-
6
votes2
answers288
viewsHow does Laravel 4 cache queries work?
I’m trying to cache my query, but I don’t know how to recover the data later. Another question: when the number of rows in the database increases, it automatically caches the query, or every time I…
-
6
votes2
answers809
viewsHow to load a view into a layout?
I’m trying to carry a view within a layout, follows my controller down below: class IndexController extends BaseController { protected $layout = 'admin.layouts.default'; public function index() {…
-
6
votes1
answer1456
viewsIncrease google login session time with Laravel 4
I work with Google API 3.0. My Laravel session expires in 5 years (not to log out anyway). But the Google session has 3 hours, IE, if the system stands still for 3 hours it logs from Google, but not…
-
6
votes2
answers2962
views.htaccess with subfolder other than root
I was working with this structure and with this htaccess: structure config/ logs/ www/ app/ bootstrap/ public/ packages/ .htaccess index.php ... vendor/ .htaccess ... htaccess <IfModule…
-
6
votes1
answer74
viewsConflicts with the Confideuser class
In my model User, left my protected $table = 'usuarios' and in auth.php the same thing, but when calling the method save() of the Eloquent, he recognizes the table 'users' and not 'users' as I…
-
6
votes4
answers7584
viewsHow to use AJAX with Laravel?
I have a select that when I change its value it should reorder a list, e.g.: by id, name, etc. without Laravel I would use a function onchange and pass the sorting pattern to a PHP page that would…
-
6
votes1
answer1417
viewsAccess permissions on Laravel 4
I’m developing a system in Laravel 4 based on official Laravel tutorials and documentation. I haven’t seen anything related to access permissions (ACL) in Laravel. Knowing that my system will have…
-
6
votes1
answer1113
viewsSet default value for database column in Laravel 4
How can I add a default value to a column of my Mysql table via Laravel 4? In SQL would be: create table tabelaTeste( id int NOT NULL AUTO_INCREMENT, coluna1 varchar(50) DEFAULT valor, PRIMARY…
-
6
votes1
answer476
viewsHow to use Angular JS and Laravel 4 without conflicting with Blade?
I would like to know how to configure Laravel 4 to use Angularjs without conflict with Blade, since the interpolation tags are the same?
-
5
votes1
answer355
viewsDoubt with relationship One to Many
I have two tables, produtos and categorias. In my view of produtos i want to show the category name of that product, not its code. Model de Categoria Category.php namespace…
-
5
votes1
answer685
viewsCatch the Average of a Relationship Table FieldMany to Many Laravel Eloquent
I have a relationship Many to Many and in the relationship table the field "value". How do I bring the media from this field using the Eloquent? Example: Tabela A a_id Relationship Table a_id c_id…
-
5
votes1
answer764
viewsCheck if Input::file exists Laravel
I have a class created by me that uploads files. I wanted to check if Input::file('image') exists, because if it does not exist, it does not upload the image. Just follow my code:…
-
5
votes2
answers338
viewsSort relation "Many To Many" using as base field of another table
I am making a virtual store, to know better the Laravel framework, and I came across the following situation: I have a table called products to store product-related information. I also have a table…
-
5
votes1
answer395
viewsRollback in specific table Laravel 4
I am manipulating a Mysql database with Laravel 4. I want to know if there is any way to do a rollback in just one of the database tables. For example, my Migration included the tables x, y and z. I…
-
5
votes3
answers1012
viewsUser Authentication with Laravel 4
I’m starting to authenticate users with Laravel 4, as a basis for this link. My doubt and the following, all route, I will have to use this way? Route::get('/', array('before' => 'auth'),…
-
5
votes2
answers1198
viewsDOMPDF: Frame not found in cellmap. What causes this error?
This problem has been haunting me for a long time and I still haven’t found a solution for it. I have developed a system, where in a given location, the user can print a report, which is generated…
-
4
votes2
answers3535
viewsDisplaying authenticated user data in the view
I have a problem that I believe is quite simple... I need to display the username logged in to my views... how do I do that? this is one of the views @extends('layouts.template') @section('body')…
-
4
votes3
answers1374
viewsShould I use routes or controllers in Laravel 4?
I’m a beginner in Laravel and I have doubts about the use of controllers, I read several examples/ tutorials and see the vast majority use the routes for example for a form request, to display…
-
4
votes1
answer128
viewsDistant relationship with Laravel
I have this table structure and would like to know if who posted the thread or the reply is Member or moderator, but I couldn’t structure a relationship that works, someone can help me? forum id -…
-
4
votes3
answers992
viewsReturn 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 several texts with the same author) and return me in ascending order…
-
4
votes2
answers2678
viewscss files in Laravel 4
I’m starting with Laravel and I don’t know where to put the css files, since there is no Assets folder, as there is in Laravel 5. I need to work with version 4, because the PHP version on the server…
laravel-4asked 9 years, 1 month ago Amanda Lima 3,428 -
4
votes3
answers1822
viewsI cannot access object property. Laravel/Eloquent ORM
I cannot access the properties of the related object. Well, I have a class calling for FileClass, she has the following relationship with class FileServico: Fileclass.php public function…
-
4
votes1
answer931
viewsPass 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 variable id for the method?…
-
4
votes1
answer783
viewsTwo conditions in SQL query with Laravel 4
I need to make a query to Mysql with two conditions. I tried to do so: $query=DB::table('veteranos')->where('ra', '2300')->where('flag', 0)->pluck('ra'); In this way, the second condition…
-
4
votes1
answer1106
viewsSubfolder problem and url rewriting with Laravel
I’m trying to do the Laravel 4 run in a subdirectory, using . htaccess to rewrite the url to the public folder Example: C:\xammp\htdocs\laravel4 The .htaccess is in rewriting…
-
4
votes2
answers3070
viewsHow to see the queries that were executed by the eloquent in Laravel?
How can I find out which queries were executed in Laravel? For example, I have the following query: $usuarios = Usuario::with('nivel')->where(['status' => 1])->get(); I would like to know…
php laravel laravel-5 laravel-4 laravel-eloquentasked 8 years, 3 months ago Wallace Maxters 102,340 -
4
votes2
answers250
viewsHow to join the query string in Laravel 4 pagination?
How do I join query string in the 4-way pagination? For example: I have a data listing and on this screen I have a search filter. When I send a get to request the filter in the list by the url…
-
4
votes1
answer1244
viewsInsert array into database 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:…
-
3
votes2
answers1735
viewsDate being recorded wrong in m-d-Y bank instead of Y-m-d
I set the date format for viewing to "d-m-Y", while the recording format is from the "Y-m-d" bank". However at the time of recording in the database, something happens and the data is going in the…
-
3
votes1
answer458
viewsError in DOMPDF library constant
I installed the dompdf package on laravel4, using Composer. However, you are giving the following error when trying to create the object: Use of Undefined Constant DOMPDF_TEMP_DIR - assumed…
-
3
votes1
answer1084
viewsGoing Up Laravel4 App for Shared Hosting
My access to this hosting can only be from the folder public_html forward, I can’t access a level back. I put all the project files inside public_html and inserted a htaccess with <IfModule…
-
3
votes1
answer759
viewsRelationship in Laravel/Eloquent ORM
I have a problem. I need to return the values of a relationship, however, presents the following error: ErrorException Undefined property: Illuminate\Database\Eloquent\Collection::$fileServico My…
-
3
votes1
answer93
viewsExtender Resource Controllers
I’m doing what I want in a way and I’m looking for alternatives or better ways to do it. I am using Resource Controllers in my application. I am also using softdelete in several models, so my routes…
-
3
votes1
answer1555
viewsWhat is the difference between Model::lists() and Model::all()->lists() in Laravel?
In the Laravel, we have a method that we can list fields from a table in the key value style. I can do it two ways Thus: Usuario::lists('nome', 'id'); And So: Usuario::all()->lists('nome', 'id');…
-
3
votes2
answers2174
viewsSort results by a relationship column in Laravel 4
Currently I have some methods that used together allow me to make requests to my application controlling the "withs", "Orders" and such via querystring. I can do, for example: GET…
-
3
votes1
answer180
viewsHow and when to create Packages in Laravel 4?
I have been researching and thinking about a subject for days and I still don’t understand how to do/use/start: Setting Package: Books (crud) Package: Authentication module (users + profiles + login…
-
3
votes1
answer993
viewsLaravel Session - Public for Controller
I’m making a form that contains a Captcha. The Captcha is generated by a PHP script that mounts an image. And I put the script in the folder public of Laravel 4. When the code of Captcha is…