Most voted "laravel-5" questions
Laravel is an open-source framework for developing web applications and services with PHP. Use this tag for specific questions about Laravel 5 or later.
Learn more…751 questions
Sort by count of
-
2
votes1
answer6290
viewsLaravel - Creating select with Form::select + Model::lists
I’m trying to create a select with the following code: My controller is like this: public function create(){ $marcas = Marca::lists('descricao', 'id')->toArray(); return…
-
2
votes1
answer757
viewsLaravel 5 - Auth::Attempt: Error using another table
Good afternoon guys, I’ve been searching on the Internet and unfortunately I could not solve my problem. I need to authenticate users using the Laravel 5.2 framework but my method needs to be…
-
2
votes1
answer107
viewsData sorting with php
I need to sort an array by a specific "order" field, where within that array I have banners objects with the id, order, name and img fields. I need to sort this array in order. the order banner 0…
-
2
votes1
answer281
viewsHow to make Inner Join inside the Auth in Laravel 5.3
In the Migration standard that Laravel brings to use the Auth, made a Foreignkey with another table linking by ID. For better understanding put here the tables and with the following columns: Plants…
-
2
votes1
answer1294
viewsHow to bring only the latest records with Laravel 5.2
I need to return the last 10 records to a view.. return view('home.home', [ 'data' => $this->sale->get(), //aqui eu quero pegar os 10 últimos 'nav' => 'dashboard' ]); There’s some…
-
2
votes1
answer236
viewsPicking up monthly items ELOQUENT MODEL
Well I need to make one query where I have to bring all the listed items of the month in which we are. In the query I’ve done I’m bringing them all with status O of OK: $vendas =…
-
2
votes1
answer8769
viewsCreate/Modify table without deleting data Laravel Migrate
I have a question about the Migrates. I am using Laravel 5.1 with Sqlite database. When I turn the remote php artisan migrate or php artisan migrate:refresh, generally to add new tables or insert…
-
2
votes0
answers358
viewsProblem when placing Application made in Laravel 5.2 in production
I’m not putting my system into production. I created a Virtualhost in the file http.conf Apache with the following configuration: <VirtualHost *:80> DocumentRoot /var/www/html/dna/public…
-
2
votes3
answers2215
viewsbelongsToMany Laravel - find()
I’m developing an Intranet that will contemplate Categories and Posts. A post can receive "n" categories. To that effect I’m using belongsToMany(). The problem is when returning this data with…
-
2
votes2
answers3637
viewsFilter records by month and year in Laravel
I have a form with a field like month, that sends a value in the format Y-m for my controller. How do I search the records for the selected month and year? I’m using L5-Repository I did it this way,…
-
2
votes1
answer814
viewsCollapse bootstrap is not closing
I’m using the following code to make a Collapse with bootstrap, it opens normally but does not close when clicking again, someone can help me? <div class="well"> <button href="#task"…
-
2
votes1
answer1201
viewsAsynchronous paging with Laravel
I made a simple pagination with the laravel using the return of ->paginate(), however, as you know, it is not an asynchronous action, which makes paging bad. I found some examples, but I couldn’t…
-
2
votes1
answer194
viewsHow to list the depedents of a particular employee with Laravel?
Hi, I happen to be taking my first steps on the Laravel. I created a database with two tables (dependents and employees), created the crud of each and display the whole system in html (bootstrap).…
laravel-5asked 8 years, 1 month ago RamonVicente 115 -
2
votes1
answer36
viewsImprove banking of related entities?
I have in the database the tables User, Professional and Address. The foreign key of User is in Professional and foreign key of Professional is in Address. I need to register a professional, who is…
-
2
votes2
answers498
viewsRegister of dependent picking ID of the respective employee with Laravel 5.2
My problem is that when registering a new dependent the input, which has the employee ID that the dependent will be related to, is automatically filled with the ID of the given user and not that the…
-
2
votes1
answer301
viewsCase-sensitive query in sql server with Laravel 5.4
I am making a query to the database (sql server) for user and password validation with Laravel 5.4 but, the query is running as case-insensitive. In the database is: pwd = Aa12a Input: password =…
-
2
votes1
answer62
viewsLaravel Queries SQL Doubt?
I’m starting with the SQL of Laravel I searched much more I did not get an answer on how to make a AND after a where, follows example code to implement a AND. SQL: UPDATE contas SET valor_titulo =…
-
2
votes1
answer363
viewsCheck route with variable on Laravel 5.1
I am using the code below to assign the class "active" when on the route "product" or "product/create". <li {!! Request::is('produto', 'produto/create')? 'class="active"' : null !!}> Now I…
-
2
votes0
answers74
viewsCall HTTP error ERR_RESPONSE_HEADERS_TOO_BIG
I am submitting a form with lots of information and I receive the following message: ERR_RESPONSE_HEADERS_TOO_BIG Small section of the code: $("#editForm").submit(); I understand that the error is…
-
2
votes1
answer364
viewsHow to change the default name of an eloquent column
I am on a project that is in production, and by default when we use a foreign key in eloquent we follow the following "user_id" rule for example to store user id. Only at the bank I’m working they…
-
2
votes1
answer1254
viewsReceiving an ajax request with Laravel
I am having problems in recovering the data sent by my ajax to the laravel. Man ajax is like this: var id = $(this).siblings(':hidden').val(), qtd = $(this).val(), dataUser = { "id": id, "qtd":…
-
2
votes0
answers96
viewsDoubts relationship too much for many
I have the following relationship: My doubt comes in the programming of the ordering model: class EncomendaProdutos extends Model { use SoftDeletes; protected $fillable = [ 'CdEncomenda',…
-
2
votes0
answers242
viewsIs it possible to sign Pdfs reports in the ICP BRASIL 15 standard with the PHP language?
The client wants the pdfs reports on my system to be digitally signed with ICP standard BRASIL 15. Question 1: PHP alone with the function openssl-pkcs7-sign signed ICP Brazil 15 ? Second question:…
-
2
votes1
answer347
viewsUse Auth class in Laravel configuration file
I’m using the barryvdh/Laravel-elfinder. This generates the configuration file /config/elfinder.php. Inside this file, I inform the path to upload Elfinder files. I need each user to have their…
-
2
votes1
answer46
viewsLarval Relationsships 5.4
I have 3 tables,[Users -> Departments -> Posts] where the Users table has many Departments that Departments has many Posts. My question is: How do I relate the 3 tables to the with() method…
-
2
votes1
answer475
viewsLaravel 5.2 - How to view @foreach in View, only logs referring to the authenticated user?
I have a record table with a field id_user, this table has data entered by some system user. I need that when the user authenticates in the system, only see the records that he created. That is, the…
laravel-5asked 8 years ago Bruno Oliveira 87 -
2
votes1
answer644
viewsHow to get the result of the query executed in Eloquent?
How do I get the result of query which will be executed in the database? Example: foreach ($prestadores as $prestador){ $achou = \DB::table('modulo_pr_espelho') ->where('prestador_id','=',…
-
2
votes1
answer2272
viewsObject of class Illuminate Database Eloquent Builder could not be converted to string. Standard 5.2
I’m having problems with a relative search on Laravel. I give option of several searches on the screen, are they: initial date final date status, and whose is but one can search in a unitary way,…
-
2
votes0
answers310
viewsPermission denied Laravel 5.5
I’m trying to create my first Windows project with vuejs. I installed apache on Ubuntu 16.04 and navigated to the /var/www/html folder. I’ve circled the following command: composer create-project…
-
2
votes1
answer363
viewsProblem with wherein Eloquent Laravel
I need to execute a query with the parameters as below: $questoes = Questao::leftJoin('capitulos_questoes', 'capitulos_questoes.questoes_id', '=', 'questoes.id') ->leftJoin('modulos_questoes',…
-
2
votes1
answer2141
viewsHost website in Aravel
I have a project in Laravel. When I put my files to my hosting server and access the domain, it shows me the files and folders instead of redirecting me to the index. On my machine I create a…
-
2
votes2
answers2166
viewsCheck Empty Fields - Orange 5.3
I have an entire field and a date field that are not mandatory and are programmed to accept NULL, but when I send the form data without filling it in my controller receives the empty value instead…
-
2
votes1
answer484
viewsUploading image to server does not work
When I upload locally, using WAMP64, everything happens normally. However, when I upload by the site, which is on the production server, the following error message is displayed. Nowritableexception…
-
2
votes2
answers954
viewsReturn Laravel json API
I’m having a problem following, I made a API and I get one back array: "id": 1, "email": "[email protected]", "senha": "lucas123", "created_at": "2018-02-15 16:48:12", "updated_at": "2018-02-15…
-
2
votes1
answer1335
viewsView in select database attributes and edit with Laravel
I was able to include the attributes through an auxiliary table by this question: Save multiple attributes to the same object in Laravel It would now need that what was set in this auxiliary table…
-
2
votes2
answers1025
viewsSum with SUM()
Two days ago I’m banging head with a query in the database marrying tables and returning the sum of values, I can perform the query by the quiet Phpmyadmin. Follows the query that works on…
-
2
votes1
answer952
viewsRedirect p/new page when 404 error occurs using Laravel 5.6
What is the correct way for Laravel 5.6 to redirect another route if it is error 404? I created the folder Resources/views/errors/ and the file 404.blade.php, and worked right, but do not want to…
-
2
votes1
answer254
viewsWhat convention is used to organize Views of Laravel?
I would like to know how to organize the views in Laravel, in which directory it is best to leave the includes, templates and main views. Also what is better to put in includes (navbar? layouts?…
-
2
votes2
answers247
viewsSend parameter from one route to another
I want to send a variable from one route to another, to display this variable in the view, use example: public function create(ExamRequest $request) { Exam::create( $request->all() ); $message =…
-
2
votes1
answer1324
viewsWhat’s the lighting for?
Currently I have ventured into the framework laravel and in some cases I came across a command in the header of my files just below the namespace called illuminate. For example: use…
laravel-5asked 6 years, 3 months ago Bruno Duarte 737 -
2
votes1
answer345
viewsHow to return relegated records between Laravel tables
I have 2 tables city and state I own the state and would like to know how to return all the cities related to the state Parana simply without having to do a loop Type $estados = App/Estado::all();…
-
2
votes1
answer6457
viewsClass not found Laravel
Good afternoon, I’m starting with my studies in Laravel, the moment I entered the Eloquent ORM I started having problems. This is my controller <?php namespace App\Http\Controllers; use…
-
2
votes0
answers348
viewsHow to integrate Eclipse PDT with Laravel 5
I wonder if anyone knows how to actually integrate Eclipse PDT IDE, with Laravel 5.x... Do I need a plugin? Do you have a step-by-step pass? I opened an existing project, however Eclipse is…
-
2
votes3
answers1024
viewsERROR: No application Encryption key has been specified
Good morning, I’m trying to download a template on this link: https://itsolutionstuff.com/post/php-laravel-57-create-admin-panel-exampleexample.html But at the time of the command : php Artisan…
-
2
votes2
answers52
viewsRandom key during user creation
In my migration of User owning: name, id, email and authorization key, however, I would like to know whether it is possible to authorization key is created randomly during user creation, this key…
-
2
votes1
answer323
viewsError auth Lockable with another model?
People changed the name of the standard model of Laravel User.php for Colaboradores.php (of course, I set the $table and the $primaryKey model), I also changed the config/auth.php to model. but…
-
2
votes1
answer940
viewsProblem with search and paging in Laravel?
The code below returns all bank records and also searches for the term entered in input search with pagination. The problem is that by clicking for example on page 2 it already refreshes the page by…
-
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
votes1
answer475
viewsAdvanced search in Laravel 5
I’m starting to Laravel 5 and as an apprenticeship I am creating a simple employee registration. What I need is to recover from the bank a relationship of employees with exams based on search…
-
2
votes1
answer1751
viewsValidation in the Laravel
I’m wearing a Form Request Validation to validate a form, but when I leave a field of the typerequired blank no error is generated. How do I generate an error when validation fails ? class…