Most voted "laravel" questions
Laravel is an open-source framework for developing web applications and services with PHP. Before asking consult the official documentation of Laravel.
Learn more…2,777 questions
Sort by count of
-
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
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
votes3
answers5260
viewsLaravel: Migrations
I have a question about Migrations do Laravel and I believe you can help me. 1 - I created a model with Migration by php artisan make:model Evento -m; 2 - In addition to increments and timestamps I…
-
6
votes2
answers626
viewsLaravel and Json Web Token
I’m having difficulty authenticating through the Json Web Token (JWT) token in the Laravel framework, I’m using the framework recently and I came across the following error. Whoops, looks like…
-
6
votes0
answers2043
viewsWork with two databases in Laravel
I’m creating an application that needs to connect to two different databases. A database I am creating (Mysql) and a database I received ready that I am only allowed to query (SQL Server). The…
-
6
votes2
answers1007
viewsHow to Filter Multiple Fields in the Query?
I need to make a filter in a query in Laravel. How can I do this in the best way ? For example, I have a query on my page and I want to filter it. For this I have a column that has some filter…
laravelasked 8 years, 6 months ago Diego Souza 16,524 -
6
votes1
answer878
viewsCustomized authentication with CPF and E-MAIL
I’m thinking of a way to authenticate users using the email and the CPF of the same, so far not found a way to do, someone has a suggestion? public function auth(Request $request) { $credenciais =…
-
6
votes1
answer1511
viewsSelf relationship in Group table with Laravel and Eloquent?
I have a table of grupo with the fields: id (int not null auto-increment) Description (sweep) grupoid (int null) How would it be: 1) to migration corresponding to that table? 2) the creation of…
-
6
votes1
answer1308
viewsCreate View in Mysql through Laravel
How can I create a view in the Mysql database through migrations of Laravel? I found nothing in the documentation.
-
6
votes2
answers4963
viewsHow do I keep the data already filled in <input> after submitting a form?
I’m using the PHP language and the Laravel Framework 5. In the form validation, if it contains a blank field or an unaccepted character size, clicking save shows the validation message, but the…
-
6
votes1
answer1202
viewsHow can I differentiate authentications in the Standard? Example: Administrator and Common User without using multauth
How can I differentiate routes for the same auth? I have a User table and in it I have registered two types of user: admin and common user, both in the User table, with the same attributes. How can…
-
6
votes1
answer324
viewsMounting a query with Laravel
I’m studying the structure of the Laravel from this example already ready => beast. In the project there is the repository userRepository with the following structure: <?php namespace…
-
6
votes4
answers2249
viewsCreate Virtualhost on port 81
I have two apaches installed for two versions of PHP (5 and 7), on port 80 and 81 respectively. I would like to create virtualhost for apache port 81 In the host file there is this line: Host…
-
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
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
answer450
viewsHow should I organize my controllers using the SOLID methodology?
I am currently developing a project and noticed that my controllers are responsible for more than one activity. Thinking about it I remembered about the Hangout of the Laravel Brazil Community about…
-
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
votes1
answer219
viewsConsultation in a Relationship Many to Many in Laravel 4
Guys, I’m "stuck" on a problem concerning a customer report. I have the following relationship: Module (id, name) Associate (id, name, superior_id) Association_modulos (modulo_id, associado_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
votes1
answer1810
viewsLaravel Results of a Query Builder for eloquent model
I am making a query using Query Builder $users = DB::select( DB::raw(" SELECT users.* from users, permissions_customers WHERE permissions_customers.customer_id in ( SELECT…
-
5
votes1
answer1427
viewsPerformance of the Eloquent of the Laravel relationship
I realize that in the Laravel 4 Framework, when we have a relationship, rather than using a JOIN of Mysql in the source code of Eloquent, he uses a select. For example. I have these two models.…
-
5
votes1
answer316
viewsWhat status can I return in an attempt to submit a form without a TOKEN?
I’d like to know what the status http I must return to my application if someone is trying to forge a request via form. The application I developed is done in Laravel 4 and I’m using that…
-
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
votes2
answers1905
viewsHow do I get the browser user’s language?
I have a website in 3 languages, EN, EN and ES. But on some distinct machines when accessing the site by the browser is directing to page on English. This happens because of the code below which I…
-
5
votes2
answers4705
viewsLaravel database connection error
Use Mamp and configure the database.php file like this 'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', 'localhost:8889'), 'database' => env('DB_DATABASE', 'estoque_laravel'),…
-
5
votes1
answer1028
viewsDifference between new project command and create-project command
What is the difference between commands laravel new nome-projeto and composer create-project laravel/laravel nome-projeto --prefer-dist? In both cases the result is the same but in the case of via…
-
5
votes2
answers604
viewsRelationship on-to-one in auxiliary table using Laravel
In the application I am working the database is built on the part of users, as follows: user 1 -------> 1 user_address 1 <-------- 1 address In the user table there is no column referencing…
-
5
votes3
answers11090
viewsSQLSTATE[42S02]: Base table or view not found: 1146 Table
I’ve got this little problem in Laravel. The good old problem with the S that Laravel puts in the end. I have researched in innumerable foruns but the given solution does not work. SQLSTATE[42S02]:…
-
5
votes2
answers1094
viewsHow to return the page with the "Chor" of the LARAVEL id?
After submitting the form I return to the page in question with two methods, redirect() and back(). In case I’m using the bootstrap tabs and would like to return with the id anchor, ex: return…
-
5
votes2
answers265
viewsForeign Key between different databases
Is it possible to link two different databases in a Migration? I am using Postgres. What do I have: $table->integer('id_cliente_produto')->unsigned();…
-
5
votes3
answers1261
viewsSelf Relationship with Laravel
I have the following problem trying to make a self relationship with Laravel 5. I want to make a user registration, where users may have other users linked, creating an autorelationing N x N,…
-
5
votes0
answers8377
viewsLaravel 5 - Timezone Wrong Time
I switched the Timezone 'timezone' => 'America/Sao_Paulo', but not getting the GMT +3, which is the one in Brasilia. You have to trade something else somewhere else, off app.php?…
-
5
votes1
answer1303
viewsAuthentication Laravel 5.2
I am trying to log in to Laravel 5.2 but it is not authenticating the user in the table. in the archive auth.php I changed the validation table to login: 'guards' => [ 'web' => [ 'driver'…
-
5
votes1
answer7829
viewsphp Artisan command serves by running multiple hosts
I am developing two applications, one that will be my front and the other the backend, it occurs that when I raise the applications for development the Framework only enables one applications, but…
-
5
votes1
answer423
viewsWhat is the hash generation algorithm that Laravel uses?
By default Laravel already comes with a pre-ready authentication system, however, someone would know tell me what the algorithm is default that this framework use for generation of hash and what…
-
5
votes1
answer1374
viewsCreate Unique constraint with two fields in the Laravel request
I have in the creation Migration of my table the following: public function up() { Schema::connection('database2')->create('empresa_funcoes', function(Blueprint $table) {…
-
5
votes3
answers245
viewsError doing Join with Laravel Query Builder
I’m doing the following Join: public function getStockDanger() { $data = DB::table('product') ->join('stock', 'product.id', '=', 'stock.product_id') ->where('stock.stock', '<=', 0)…
-
5
votes2
answers781
viewsCreate profiles in application
I need to modify my application so that each user sees its particular content, because each user will have information of its own. I’ve set up the default authentication using make auth and it’s…
-
5
votes2
answers2110
viewsLaravel - Route with variable
Good morning Sirs. I have a question about the route in the Laravel, I carried through researches trying to find the result but I did not find what I wanted. I need that from the id that is…
-
5
votes3
answers436
viewsHow to order the query in the same order as an array used in Wherein?
I would like Laravel to return me a list of products where the ID belongs to this array: [12,5,1,8,16], but sort by id as per array order!* What I have so far: $produtos = Produto::whereIn('id',…
-
5
votes1
answer38
viewsLaravel + Android
I am starting my studies in the framework Aravel and saw that it is very useful to create websites, however, is it possible to consume these routes in native android ? Because routes are usually…
-
5
votes1
answer330
viewsHow to save bank data in the database?
When making a virtual store what is the best way to save the user’s bank data in the database? Credit card number, security number and expiry date. For example, using Laravel. It would use a type of…
-
5
votes1
answer203
viewsWhat is the importance of specifying the size of a field in the field?
I would like to know if it really is, and why it is important to pre-specify the size of some string/text/... field in the Migrations in the Laravel. From what I imagine, maybe these specifications…
-
5
votes1
answer803
viewsGetting information from an array within a foreach - PHP
Good afternoon. I’m developing a PHP application using Laravel, and I’m having a hard time. I have a table with the Account name, which has the code of this account, represented by the variable…
-
5
votes2
answers462
viewsLaravel multitenancy with a user-only BD
I’ve been researching about Saas and Multi-tenancy but has little material in Portuguese. I saw that it is possible to make a database for each company, but my question is: You can make a unique web…
-
5
votes1
answer132
viewsComparison of hours in Laravel
I’m trying to create a method that will return the amount of minutes since the last insertion in the bank. That’s the way I did it, but I’m making a mistake: $now = Carbon::now(); $minutes =…
-
5
votes1
answer195
viewsLaravel Auth with Subdominio
Good morning, I’m trying to perform an auth with Ubdomain, but every time soon on the site returns the error of Too Many Redirects. This is my .env: SESSION_DOMAIN=.meudominio.com.br And the first…
laravel laravel-5 laravel-routes subdomain routingasked 5 years, 4 months ago Vitor Marileu Figueredo 155 -
5
votes1
answer51
viewsHow to wait for a user action on a Job?
The Situation Having a service queue, where whenever a user enters the queue he receives a position number in the queue, I need to request the presence of the first of the queue. If the first row…