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
-
1
votes2
answers200
viewsHow to send email without a view
All tutorials I think about, including the official documentation show how to send emails using views. How to send emails without any view? As a system routine automatically?
-
1
votes1
answer1419
viewsHow to add my validation in Laravel Validator?
In the Laravel, both the 4 and the 5, we have the class Validator, which allows specific validations to be made. By default there are several, such as required, email, same and others. But I would…
-
1
votes0
answers103
viewsWHERE Inner Join clause
Good people, I have a form that should be filtering the selected fields looking for direct information in the database, however I do not know how to use the Where clause, can anyone here help me or…
-
1
votes1
answer169
viewsDynamically Set Connection in Model Laravel 5.1
I saw that I can use different connections for my models by defining as follows: class Aparelho extends Model { protected $connection = 'minha_conexao'; protected $table = 'aparelhos'; } But how can…
-
1
votes0
answers616
viewsSlow PDF creation - DOMPDF Laravel5
I am currently using the Barryvdh Dompdf to create reports in a system made with Laravel 5.1, but it is very slow because of the size of the reports, so that, for many times (almost always), it ends…
-
1
votes2
answers2904
viewsHow to redirect the authenticated user to a specific page?
I am restricting the registration page only to be shown or accessed after the login. A friend of the stackoverflow group told me that could be doing this way: public function __construct() {…
-
1
votes1
answer513
viewsHow do I run Artisan in a specific environment?
How can I perform the Artisan as a specific environment? 'Cause when I spin php artisan tinker It is generating an error because it is recognizing the configuration of the production database. But I…
-
1
votes1
answer246
viewsReturn query via ajax
Good evening, could someone please help me with this: I made a select and gave a "get()" at the end to get the results, I passed them in an array I’m picking up a Function via ajax: $table =…
laravelasked 8 years, 7 months ago Lincoln Binda 319 -
1
votes1
answer511
viewsInsert page break when generating PDF with Snappy PDF in Laravel 5
I am generating a PDF in Laravel using Snappy PDF. The problem is that it is not breaking the page in the place it should. I’ve tried using the page-break-after: always of the CSS in the place where…
-
1
votes2
answers439
viewsLaravel Ordination with Relationship
I’m looking to make a related consultation, but the ordering should be done by a field from another table that is in the relationship. $consulta = Dealer::whereIdMarca($codMarca)…
laravelasked 8 years, 7 months ago Diego Souza 16,524 -
1
votes1
answer513
viewsBring BD data with javascript
Hello ! I have a MENU and a submenu within each item of this menu. Every time I click on a menu item, it opens a sub-menu (accordion effect). There’s a way to make a select within the database and…
-
1
votes1
answer344
viewsDifficulties in Route Creation and Laravel Controller 5.1
I created a CRUD with Modal is working all right but I created request form data display, queries with BD all within Routes, I do not think very cool would like to pass these features to the…
-
1
votes1
answer657
viewsCreate Postgres "Numeric" Field in Laravel 5.1
I need to create a field like Numeric existing in postgres using migrations from the Laravel, can anyone tell me how I do? I tried that, but it didn’t roll: public function up() {…
-
1
votes1
answer388
viewsPick up zip in another bank in Laravel 5
I’m doing a registration system using the Laravel 5, I created the client scheme, with some tables such as person, address, email, phone. happens I have another bank, called cep, where has some…
-
1
votes1
answer607
viewsFormat En date controller
Good afternoon, if anyone can help me with this problem I’d be grateful I have the following form: <div class="form-group col-md-12 col-sm-12 col-xs-12"> <div class="col-md-2 col-sm-2…
laravelasked 8 years, 7 months ago Lincoln Binda 319 -
1
votes1
answer241
viewsIs there any way to define a specific title on Laravel routes?
In the Laravel 5, I am creating a menu dynamically, making a foreach in the list of registered routes. So I can have a menu displayed each time a new route is created, but I’m only listing the ones…
-
1
votes1
answer1551
viewsLaravel - List with list of tables (state/city=>person)
I have the following tables: contacts => id - name - state - city states => id - status - acronym cities => id - city - id_state And the following models: Php state. <?php namespace App;…
-
1
votes1
answer118
viewsRoutes in Laravel
When prefixing the middleware auth, as below, I am automatically implementing also middleware web? Route::group(['prefix' => 'painel', 'middleware' => 'auth'], function() { // }…
laravelasked 8 years ago Fábio Jânio 3,407 -
1
votes1
answer745
viewsProblem Routes Laravel
I’m using the Laravel 5.3 and in the course I’m doing asks for on the Routes put the following line: Route::get('/produtos', 'ProdutoController@lista'); But putting it that way is a mistake:…
-
1
votes1
answer182
viewsLaravel - Search if there is a relation in the many-to-many table
I need to search users according to some filter attributes. I have the table contacts: id | nome | email 1 | asd | [email protected] 2 |teste | [email protected] The table groups: id | grupo 1 | grupo1 2…
-
1
votes1
answer160
viewsWhat is the best way to query a user’s data in Laravel?
When presenting multiple user data in a view, it is more advisable to do it in what way? Option 1 (pass data to view): $usuario = Auth::user(); return view('painel.usuarios.perfil',…
-
1
votes1
answer46
viewsProblem making a field search by date and id
I made a field search however I am not able to search by date or id. The database I use is Postgres, I’m using Laravel 5.2 framework public function scopeSearchByKeyword($query, $keyword) { if…
-
1
votes1
answer150
viewsLaravel 5.2 subtraction in the same column
I am starting in Laravel (5.2) and need to assemble the query down in the Builder! Practically it subtracts the previous value from the same column. It works normally, but I’m migrating to the…
-
1
votes1
answer76
viewsMount array with users Permissions
I need to mount an array in PHP (LARAVEL) and I’m not finding a way to do. I have a user system with roles and Permissions. When I view the user, I list all the Permissions, but one below the other.…
-
1
votes0
answers98
viewsLaravel 5.2 Redirect::back()->with and Redirect::back()->withErrors does not work
I have already developed several applications with Laravel. The problem arose when suddenly in version 5.2 the Redirect::back()->with and Redirect::back()->withErrors command stopped working.…
-
1
votes3
answers1420
viewsHow to get only the month of a date with Laravel 5.3?
I need to take just the month of a date that comes by a $request. But I don’t know how to do it: if ($request->parcelas > 1) { $mes = $request->data_vencimento = date('m'); for($i = 0; $i…
-
1
votes1
answer1487
viewsReturn select field value in Laravel
How do I return the value that is in the database of a select field and continue showing the other options to edit: <div class="form-group"> <label>Tipo de imóvel</label>…
-
1
votes1
answer182
viewsCombobox with yes and no on the Laravel
I have a combobox that has the values yes and no. He is bringing the value not put in the bank but the edit form does not appear the other option that in the case would be yes. How do I make the…
-
1
votes2
answers499
viewsApi Restful Lockable 5.2
Hello, I am trying to create an api in Laravel 5.2 what I’m trying to do is this: 1 - continue using default auth system for web user. 2 - create an api for users of an application. I am using the…
-
1
votes2
answers1613
viewsLaravel, foreach and database
I have the following table in the database public function up() { Schema::create('cidades', function (Blueprint $table) { $table->increments('id'); $table->integer('uf');…
-
1
votes2
answers1063
viewsGrab image inside Storage folder
I’m uploading images to the folder storage, app/public, inside this created a folder /banners and I’m uploading these images into this folder. How can I take these images and display in the view?…
-
1
votes1
answer86
viewsIs there any way to get the original value of an attribute of a Model then modify it?
I am using the Laravel 5 and would like to know if, after modifying an attribute of a model, it is possible to recover it. For example: $usuario = Usuario::where(['nome' =>…
-
1
votes1
answer65
viewsCall Artisan commands directly from the code
Hello! I am studying Arabic, and I would like to know if it is possible to call the Artisan commands in the Controllers. Example: When the user clicks on the button he executes an Artisan command, a…
-
1
votes1
answer55
viewsError mounting Foreach Laravel 5.1
I’m trying to set up a filter where I search some options BD I made a foreach to bring this data from BD but is bringing an error: Trying to get property of non-object Follow my code: Controller…
-
1
votes0
answers116
viewsTakes first SQL Bullider Laravel record
I’m not getting the first record without using foreach query = "SELECT *, (SELECT count(*) FROM corridas c WHERE c.motoqueiro = u.id AND (c.status = 0 OR c.status = 1)) as corrida…
-
1
votes1
answer634
viewsLoad a Combobox with Selected Value
I need to edit an equipment register that has multiple combos and when you click edit load the select already with the selected selected. I thought Laravel automatically identified, but it doesn’t…
-
1
votes2
answers460
viewsUsing theme with Laravel
Well, I need to use a theme but I’m not understanding where to put the files, besides this I’m having problems with the import of css files, actually the files I’m putting inside views. My folder…
laravelasked 8 years, 4 months ago Renan Rodrigues 3,709 -
1
votes1
answer164
viewsSearch in mysql by Javascript
Good morning, I’m trying to make a check if the typed Cpf already exists in the bank, I’m using Portable, could someone help me in this function please? In my controller I search and list all the…
-
1
votes0
answers77
viewsHow to change dev-master releases to stable
I’m creating a package for sockets in PHP for Laravel, but I can’t just use Composer require because the package is in dev-master and of course I don’t want to change all my main application to…
-
1
votes2
answers304
viewsLaravel search function returns Tokenmismatchexception error in Verifycsrftoken.php
Good evening friends, I am new to the Laravel and I need to build a function for data search of a table, I did something based on what I understood so far, but this returning me the following error…
-
1
votes3
answers4878
viewsHow to use Laravel delete route?
I have the following route: Route::delete('/{id}', 'PessoasController@delete'); But with the following form I cannot access the route: <form action="/45" method="DELETE"> <button…
-
1
votes1
answer6043
viewsHow to make mask for display phone, cnpj, Cpf, etc on Laravel
I am beginner in Laravel and would like to display fields like CPF, CNPJ and Headphones formatted as (xx) xxxxx-xxxx, etc. I searched and found a function that would perform this (Mask:…
laravelasked 7 years, 10 months ago João Paulo Silveira 19 -
1
votes1
answer766
viewsHow to configure the host file to direct to the server of a "virtual box" virtual machine?
I have a virtual machine windows 7 using virtual box. Inside this machine I have a study project. Inside this machine I access this project through the url "lara/", configured in Routes. I would…
-
1
votes1
answer499
viewsDynamic list in alphabetical order?
Within that array of my dynamic list, its contents are returning in a way disorderly, how do I put it alphabetically? <div class="form-group"> <label for="nome">Categoria do…
-
1
votes1
answer1056
viewsIs it possible to access multiple databases in the same project of Laravel 5?
The scenario is this: I have a website that can be accessed by 5 different countries -> br.meusite.com, us.meusite.com, fr.meusite.com, ... . All Urls direct to the same folder within the server…
-
1
votes2
answers493
viewsSpecify columns in a relationship with Laravel
I have a relationship of User with Role. User::with('role')->get() In the case, User has the columns: id, name, role_id, created_at and updated_at. And Role has: id, name, slug, created_at,…
-
1
votes1
answer242
viewsLaravelexcel is converting the header values of an excel sheet. How to disable this?
I am using the Laravelexcel library to import data from an excel to a database. To get the header data from my spreadsheet, I do the following: Excel::load('file.xls', function($reader) {…
-
1
votes1
answer1648
viewsExample of importing XML using Lavarel
Does anyone have a clear example to import XML using Laravel Parser or Simplexml ...? I have a scenario where I have to import an XML from an external system that contains various information…
-
1
votes1
answer191
views -
1
votes1
answer743
viewsLaravel x Cakephp
I’m starting at Laravel (5.x), but I’ve had years of Cakephp experience and I’d like to clear up some doubts, because I haven’t found anything like this on the Internet: 1) Can I only create models,…