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
-
2
votes3
answers480
viewsHow do I know and count the number of rows in an SQL query with Laravel?
$teste = DB::table("cnaes") ->select("id") ->where("cnpj", $cnpj) ->where("cnae", $cnae); How can I know how many lines were affected by this query?…
-
2
votes2
answers218
viewsLaravel/Eloquent - Undefined variable: idPedido
I have two queries searching the model. The first one is working normally: $pedidos = Pedido:: orwhere(function($query){ $query->where('user_id', $_SESSION['idUsuario']) ->where('status',…
-
2
votes1
answer182
viewsPass information between two PHP pages
good afternoon! I’m having the following problem: I have a page named php locality which has the fields "name" and "city". In the name field, I enter the name of the locality, as for example,…
-
2
votes1
answer132
viewsI’m having trouble ordering the birthday boys of the month on Eloquent of Laravel 5.7
My query returns the birthday boys correctly, but when sorting by table column it sorts by year and by day. This is my query $birthday = \App\Admin\Clients::whereMonth('birthday',…
-
2
votes1
answer105
viewsSelect columns in different tables
I am using Laravel 5.3 and would like to use columns of two different tables related to foreign key: For example: Client table id | nome | end_cep 1 | carlos | 69084555 2 | Maria | 69088555 Address…
-
2
votes0
answers292
viewsI can’t access the IP of the hotel
Good morning, I’m trying to install the Homestead from Laravel 5.5, following the documentation. However, when I try to access IP 192.168.10.10, which is the default IP of the Homestead, it keeps…
-
2
votes1
answer768
viewsProblem with download PDF file with Laravel
I have a system to download PDF files, which is happening and I try to download, and it just doesn’t download. I’ve seen in the by the inspector of the Chromo and there is no mistake. Controller…
-
2
votes1
answer1766
viewsOptional parameters on the Laravel Route
I’m passing parameters on a Route using Laravel 5.8 like this: Route::get('/cursos/{id_categoria_curso}/{id_atuacao_area}', 'SiteController@cursosFiltro')->name('cursos'); I want to make the…
laravelasked 5 years, 1 month ago Junio Araujo 91 -
2
votes1
answer407
viewsHow to not show error screen for User - LARAVEL
Good morning guys, how do I not show the error equal to image for the User? This image is just an example…
-
2
votes2
answers1087
viewsOpen a tab by clicking on the navbar link
I have a navbar that has several links to the same page that has 3 tab. I need that by clicking on a navbar item it opens the page with the specific tab selected. I tried to do so (but it didn’t…
-
2
votes1
answer210
viewsData Recovery Problem in a Portable Application
My table is as follows: ╔════════════════════════╗ ║ USER ║ ╠═══════════╦════════════╣ ║ Id ║ Integer ║ ║ Name ║ String ║ ║ Address ║ String ║ ╚═══════════╩════════════╝ I have some data already…
-
2
votes2
answers526
viewsPassing of parameter Laravel
As step 2 or more variables on the route? View <a href="{{route('transferir.edit', [$destino->servidor->idservidor, $destino->setor])}}" class="btn btn-default btn-xs"…
-
2
votes1
answer1148
viewsProblems with paging in the Standard
I have a page where is listed the title of all news site, and has pagination. I was asked to put a field of research, to facilitate the search for a certain news. I was able to make this form and…
-
2
votes1
answer170
viewsPDF in Binary DOMPDF Standard
I have a problem in the Windows when mounting a PDF. It gives the output all in binary. I am https://github.com/barryvdh/laravel-dompdf Look at the code: public function relatorio($id) { $pedidos_id…
-
2
votes1
answer719
viewsRoute and form in Laravel
I have a route Route::get('/','WebController@index'); I have a controller public function index() { $cars = Cars::table('cars')->get(); return view('web::index')->with('cars', $cars); } And in…
-
2
votes1
answer270
viewsDoubt in consultation Groupby and Checkbox - Laravel 5.5
I am developing in PHP in Laravel Framework 5.5 and have the following code to create my checkboxes. {{-- percorrendo a tabela para exibir os checks--}} @foreach($permissoes as $keys =>…
-
2
votes1
answer241
viewsModel Laravel 5.2
Good morning. In need to insert/update the data from a table of my database, however I do not know the columns that can contain within this table, because the system is very flex. I created a modal…
-
2
votes1
answer232
viewsLaravel 5.5 : Wherehas in relationship Many to one
From what I understand in the documentation, to the whereHas it is necessary to have a get at the end of query, but I need to use the first, since I’m picking up the information from a particular…
-
2
votes2
answers1412
viewsRequest Variable does not return input file
Why can’t I get the View file? I have a form that directs to a route. Among other attributes, I have an upload of files. This file upload is the only attribute not shown in request. <label…
-
2
votes1
answer2714
viewsAjax Request with Laravel 5.4
I’m trying to perform an example of requisition Ajax with the Laravel 5.4. The example for testing is simple, just enter a numerical value in a field input=text in my View and leaves the field to…
-
2
votes1
answer153
viewsProblem in Query Builder Laravel
I am in doubt in a query with joins in my project, when running Select directly in the database I have no problems, but when building with Query Builder I get no results. Where would I be missing…
-
2
votes1
answer55
viewsKeys in PHP Array
I have a very stupid doubt, I was able to identify the problem, but I could not solve it. hahahaha So here’s the thing... I have the following array: array:7 [▼ 1 => array:5 [▶] 2 => array:5…
-
2
votes1
answer616
views -
2
votes1
answer420
viewsBest way to generate Holerite, I seek a more viable solution
I developed an application that generates Holerites, and for this I need to process data from 4 tables. Employees -> Companies -> Salaries -> Discounts I want to show my user the following…
-
2
votes2
answers57
viewsError in Laravel 5.0
I have a connection problem in Laravel when running a query: PDOException in Connector.php line 47: SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)…
-
2
votes1
answer167
viewsUse Laravel’s Crypt without using the framework?
I need to use the "Crypt" component but separate without using the framework, I installed it via Composer. https://github.com/illuminate/encryption include 'vendor/autoload.php'; use…
-
2
votes1
answer102
viewsInsertion in the bank with relationship N : M
I need to insert users into my database MySQL already with the relationship N:M, but I don’t know how to do it. Migrate: Schema::create('usuarios', function (Blueprint $table) {…
-
2
votes2
answers898
viewsUpdate with ajax in Laravel
I have a project in Laravel and I want to make sure that when the user type something in the text field, when taking the focus of the field he makes a request ajax to the server to update the…
-
2
votes1
answer13
viewsWhat approach should be used in Resource type controllers to list and search for items?
I created the controller Artigocontroller of the kind Resource, then I have the verbs and default routes. I use the method index from my controller to list all articles (paged): $artigos =…
laravelasked 6 years, 8 months ago Fábio Jânio 3,407 -
2
votes2
answers970
viewsHow to resolve conflict between Vue.js and Laravel 5.4 no. Blade
I have the following element in . Blade (intended to interact with Vue not with Laravel): <div id="app"> {{ message }} </div> To try to activate Vue: window.Vue = require('vue'); var app…
-
2
votes2
answers808
viewsHow to automatically move data to the view in Laravel Resource Controller?
I am using Laravel 5.6 with Resource Controller. My show method: public function show(Artigo $artigo) { $artigo = $artigo->first(); return view('painel.revista.detalhes', compact('artigo')); } It…
-
2
votes1
answer923
viewsSelect with Laravel foreign key
Hello, I managed to solve a foreign key problem just now and came across a second, I have no idea how to recover in a select in the view the data from another table. If anyone could give me a simple…
-
2
votes1
answer65
viewsCompile multiple JS keeping the original names
Guys, I have a folder inside the Resources called js where you have several JS files and subfolders with other Jss. How do I set up Laravel Mix to compile all the contents of the JS folder including…
-
2
votes2
answers714
viewsReturn relationship data and generate PDF in Laravel/Dompdf
Hello, I have a problem and I found a part of the solution here, I am dealing with it in a different way in another question, but I decided to test a way that I saw here of the user Vigilio on…
-
2
votes1
answer619
viewsSend data via post
I have the following method namespace App\Http\Controllers; use Illuminate\Http\Request; use Validator; use App\Pessoa; class PessoaController extends Controller { public function lista( Request…
-
2
votes1
answer57
viewssend login information to the bank for comparison
I am developing a system with login and password, using Windows. The registration part was even easy: public function salvar(){ $usu_email = Request()->input('usu_email'); $usu_senha =…
-
2
votes0
answers47
viewsHow to load relationships on multiple levels?
Hello, I am trying to perform searches in 3 related tables as follows Contracts belongsTo -> hasMany -> company_addresses. I would like to display company_addresses data in the Contracts view.…
-
2
votes1
answer2197
viewsLaravel - Validate Unique field in update
I have a plate field on the table that needs to be unique IN MIGRATION Schema::create('professors', function (Blueprint $table) { $table->increments('id');…
-
2
votes0
answers143
viewsComposite key in Laravel migrate
I would like to create a double primary key with an auto increment field "id" and the "term", but it gives error and I do not know the correct way to do, if anyone can help me, I would appreciate it…
-
2
votes0
answers56
viewsSOAP-Laravel-CRUD
I’m using laravel, ubuntu, apache2 and the library zendframework/zend-soap. I managed to do the client-soap and I’m trying to do the server-soap. I managed to make a select with the server-soap in…
-
2
votes0
answers143
viewsAngularjs data pass to Modal
My problem is loading information into a modal. Controller Pai: App.controller('adminSolicitacoesCtrl', function($scope, $location, $auth, solicitacaoAdminService, EmpresaService, $filter,…
-
2
votes1
answer99
viewsHelp with grandfather, father and grandson relationships
I am learning and enjoying using the Standard, but I have some doubts about relationships and how to get the result I want. have the tables: TB_FORMULARIO - ID_FORMULARIO - NO_FORMULARIO TB_CAMPO -…
-
2
votes1
answer200
viewsLaravel call variavel
I am new in the Lockable and I’m trying to call the variable as I saw in the video class but still giving error control <?php namespace App\Http\Controllers; use Illuminate\Http\Request; class…
laravelasked 6 years, 5 months ago Cyber Hacker 469 -
2
votes1
answer196
viewsReturning an array object item
Well I need to go through an array and return a property of the object of that item in question. My array has this format: I tried to solve this with the following function: public function…
-
2
votes1
answer51
viewsTable consultation with CONCAT and JOIN?
I need to get a collection as a result of consultation on 3 tables using concat and join, the image below shows the relationship between them: I tried using the code below $teste =…
-
2
votes2
answers213
viewsLaravel - Use OR inside the Where
I’m using the remote ->cont to count the return number, and for that I put a condition using the ->WHERE but when I try to put a || in the condition of the error he searched and I can not find…
-
2
votes1
answer1789
viewsError: Method Illuminate Database Eloquent Collection::save does not exist
Good afternoon guys. I’m developing an application that uses the Framework. I have the error below when trying to save Checklist items. The error occurs in the second save() of the registration…
-
2
votes0
answers170
viewsConvert sql into eloquent
How can I convert this code sql in the eloquent? SELECT CONCAT(FLOOR(sum(diferenca)/60),'h',MOD(sum(diferenca),60),'m') as tempo FROM (SELECT TIMESTAMPDIFF(MINUTE, m1.created_at, min(m2.created_at))…
-
2
votes1
answer4203
viewsLaravel Validation Unique
I have a registration form, and in it there is information for popular two tables: User(User); Shipper(Sender). I created the Request Laravel to isolate the controller form validation rule. Cloquei…
-
2
votes1
answer649
viewsFilter with paging - Laravel
Good night, The filter itself appears right, but when you go to another page (by paging), you lose this filter. I can’t find the problem, someone can help me? My route:…