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
-
4
votes1
answer309
viewsHow to recover categories linked to a post?
I climbed on Github (https://github.com/fabiojaniolima/larablog-beta) a small project in Laravel, something very initial. I intend as soon as possible to arrange the routes, structure the methods,…
-
4
votes3
answers640
viewsHow to resolve foreign key error 150 in Migration with Laravel?
I’m having trouble creating the foreign key in Migration. I am working with PHP, LARAVEL 5.3 and MYSQL. You’re making the following mistake: Below is my code: Table Migration categs class…
-
4
votes1
answer1055
viewsLaravel Project does not recognize my Javascript file
This is the structure of my project: As you can see in the image above the app.js file is in the folder Assets/js my app.js file looks like this; //var urlUsers =…
-
4
votes1
answer239
viewsDownload File via API + Lumen + Maatwebsite Excel
I have an Angular 5 application that requests the backend made in Lumen 5.6, in this backend, I have a function that creates an excel file, with the Maatwebsite Excel library, for download. However…
-
4
votes2
answers972
viewsMissing required Parameters for [Route: ] [URI: /{}/]
I am trying to pass an update parameter, but it is giving error. Controller public function update(ColaborationFormRequest $request, $id { $dataForm = $request->all(); $colaboration =…
-
3
votes2
answers238
viewsForm construction
After several months without using Laravel, I now return with this version 5. It may sound silly, but I’m having trouble creating a simple form. Apparently Illumiante/html is not coming by default…
-
3
votes1
answer1219
viewsUpdate on Laravel 5 a field receiving the value of another field from the same table
I have a configuration table in my database that has the following fields: ["id", "texto", "textoOriginal"]. Initially the field values texto are equal to the field textoOriginal, but the user can…
-
3
votes2
answers463
viewsChange pagination HTML in Laravel 5.1
There is a way to change the HTML returned by the method render(), in built-in Laravel 5.1 pagination? Note: I solved this by creating a helper that uses str_replace(), but I believe it is not the…
laravel-5asked 9 years, 2 months ago Leandro Hermes Neto 117 -
3
votes2
answers1412
viewsList Tree Categories in Laravel 5.1
I’m starting with Laravel 5.1 and I’m a little lost yet. I need to list categories, subcategories and "sub-subcategories". Table: Categorias ------------------------ id | int nome | varchar…
-
3
votes1
answer264
viewsChange Laravel Migrations table nomenclature 5.1
I am creating an application that should be scalable and for this has been done a full scope of tables, relationships and the like. In this scope, I use the table migrations that Laravel 5.1 handles…
laravel-5asked 9 years ago LeandroLuk 4,989 -
3
votes1
answer49
viewsCreate Schema with Laravel 5.1
Is there any way I can get Laravel 5.1 itself to create a database as this database does not exist? ( can be either in a table of a master bank or from the same comic book itself... whatever)
laravel-5asked 9 years ago LeandroLuk 4,989 -
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
answers6305
viewsHow to insert an image using Laravel Blade 5.1
If I need to insert a css file or a script, I should do it respectively: <link href="{!! asset('css/style.css') !!}" type="text/css" /> <script type="text/javascript" src="{!!…
-
3
votes1
answer341
viewsDesign versioning Standard 5.1
I do a project in Laravel 5.1 and use the XAMPP and all settings as database this site,(home computer) etc. Only I went up (push) for Github this project only when I go on the work PC I clone the…
-
3
votes3
answers2107
viewsRoute access control - Laravel 5.1
I have some views that only clients can access, and some that only administrators can access. What I defined in this case is id_client, which if it is "1" is administrator and if it is any other…
-
3
votes2
answers1031
viewsValidate jpg file - Laravel 5
I’m trying to use the Validator to validate the upload file type but not sure if the syntax is correct $data=Input::all(); $file = $data["picture_url"]; $rules = array('picture_url' =>…
-
3
votes3
answers3733
viewsCustomize field name in validation error messages
I’m using the Laravel 5.2 Standard Authentication Controller: php artisan make:auth As the names are in English, I need to change to Portuguese. I have already set the locale to Portuguese, in…
-
3
votes1
answer614
viewsError running db:Seed command
I am studying Laravel in version 5.2 and when running the command php Artisan db:Seed returns the following error: [Invalidargumentexception] Unable to locate Factory with name [default] [Codepub…
-
3
votes1
answer649
viewsLaravel 5.2 pages redirecting in the POST without showing validation errors
In Laravel 5 whenever I try to send a post to save or edit the data, a redirection occurs in all requests with the status 302 . This is occurring on any page of the system where I make a POST to…
-
3
votes1
answer295
viewsError using a function within a PHP array
I’m using the laravel 5.2 and in my class IndexController I am trying to create an array with the function date('Y') thus: <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use…
-
3
votes1
answer269
viewsHTML with Laravel 5.2
I have a button in my index. I want to call another page as I do in Aravel 5.2 ? It would be through the routes ?
-
3
votes2
answers851
viewsCombo Cities with Laravel 5.2
I’m starting my studies on Laravel. My project is a simple customer registration where I would like to do a combo of States with Cities. Follow codes: MODEL STATES <?php namespace SGW; use…
-
3
votes1
answer7283
viewsHow to format monetary value in Laravel
I would like to know how to format monetary values in Laravel. Is there a Package or method that is for the framework? {{ $lst->vl_valor_tot_contrato }} is displayed with monetary formatting…
-
3
votes1
answer3702
viewsLaravel - validate input arrays and return values in case of error
I am creating form using the following code: In the create.blade.php file {!! Form::open(['route'=>'orcamentos.store']) !!} {!! Form::text('descricao', null, ['class'=>'form-control',…
-
3
votes2
answers412
viewsHow to find out what is the first or last item of the Loop in Laravel?
I got the following foreach in Laravel. @foreach($values as $value) <li>{{ $value }}</li> @endforeach I would like to add a special information when it comes to the first loop item. In…
-
3
votes1
answer1321
viewsCreating datetime field with Laravel Collective
I’m creating a field using the Laravel Collective however I am having problems with the field date, first I am not able to create the field DATATIME and another problem is that it is coming the…
-
3
votes3
answers379
viewsHow to convert database timestamp to fill a datetime-local field?
I need to fill in a field: <input id="date" type="datetime-local" class="form-control" value="{{$task->date}}" name="date"> The return comes in format timestamp ("2016-09-20 10:00:00"), is…
-
3
votes1
answer977
viewsHow does Laravel read the file ". env"?
How Laravel does to read the file ". env"? I’ve looked in the repositories of Illuminate (from Laravel) and I didn’t find anything that gave me a hint of how to read this file. Is there a library…
-
3
votes3
answers357
viewsData bank without foreign key in Laravel
I attended a class where a stock system is created in Laravel where there is the product and the category. But there is no foreign key, only one column categoria_id. How is this relationship done?…
-
3
votes2
answers322
viewsHow to compress the output of an HTML in Laravel?
I answered that question here once talking about the subject: Store PHP script output in HTML "compressed". But now I’d like to know how I can do it in Laravel. When it comes to an HTML response,…
-
3
votes1
answer955
viewsWhat are Events in the Flat for?
I never used Event in Laravel and I would like to know what is the purpose and if it has some advantage.
-
3
votes1
answer5730
viewsPlease provide a Valid cache path
I just made a git clone (copy) a newly made Laravel application in the company where I work. I surrounded the composer update and artisan key generate to make initial settings as well as edited the…
-
3
votes1
answer83
viewsHow to identify in the constructor the method that was called?
How do I stop at builder of my controller identify which method was called? I’m using the Laravel 5.3 and my controller follows the pattern resource (index, show, edit...).…
-
3
votes1
answer512
viewsHow to pass two variables from a view to the controller?
i have a link where I already pass a variable to the controller. It works ok. How do I pass two? My link in View: <a href="{{url("/ordemvar/$equipam->codigoequipamento")}}"><i…
-
3
votes1
answer994
viewsCall to Undefined method Illuminate Database Query Builder::lists()
I’m having a problem creating a list of types for my project, for some reason in others Controller worked perfectly but in this unfortunately not. I’m doing the method create of my Controller public…
-
3
votes0
answers394
viewsLaravel in Linux with NGINX. Error 500 in browser and Permission denied in log. An analysis and how to solve in the best way possible?
I am installing an application in Laravel 5.4 in a Linux environment Ubuntu 16.04 with NGINX. I have seen that many people (just like me) always come across a 500 error in the browser, just after…
-
3
votes2
answers145
viewsObject property from JSON is not accessible
Well I’m working with the framework Laravel in versão 5.2 I’m developing a API where I have a Painel administrativo that produces and manages the content in the case in question produto, and I have…
-
3
votes2
answers3927
viewsHow to edit the routes created by make:auth?
I have a project at Laravel where I used the command make:auth to create the views, routes, controllers etc, a registration form. I need to change the a view which is used by default in login for a…
-
3
votes1
answer2542
viewsHow to access Vue-Router dynamic route parameter
Using the Vue-router, I came across a problem, when I weigh a dynamic route, like { path: '/horario/:dia/:hora', component: Bar }, a problem happens, I can access the values of day and time on the…
-
3
votes2
answers7000
viewsLaravel, call Action from a Controller from a View?
I have a View where inside it I would like to add the link of a Controller with your Action specifies and when loading this View to Action that Controller be triggered. Example: within a View I have…
-
3
votes2
answers315
viewsProblem in a foreach
I’m using Laravel 5.3, and by making a foreach in the view, it does not recognize as an object, but if I print only what is in the variable $user it prints an object json. Controller: public…
-
3
votes2
answers49
viewsHow to perform a query of a query stored in a string through the DB class?
I wanted to convert this query how to use it in DB Facades Lavarel SELECT FIND_IN_SET(KillCount, (SELECT GROUP_CONCAT(KillCount ORDER BY KillCount DESC) FROM users)) AS Rank FROM users WHERE id = 1…
-
3
votes1
answer416
viewsProtecting a route used by a single domain
I have an Laravel application hosted in a subdomain and need to allow your API (which has a single POST route) to be used solely by the application hosted in the main domain. What is the simplest…
-
3
votes1
answer10458
viewsHow to use Inner Join in Laravel 5?
I have the following loop in a view table @foreach ($filme as $f) <tr> <td>{{ $f->fil_id }}</td> <td>{{ $f->fil_filme }}</td> <td>{{ $f->fil_sinopse…
-
3
votes1
answer1363
viewsLaravel and Front-End
Well , I wanted the opinion of some dev’s who have gone through the same dilemma I’m going through right now, I don’t know if this is the right channel to realize this question. I have to build an…
-
3
votes1
answer186
viewsFunction extension on the Laravel
I’m using the Laravel 5.3 and apparently I have a Controller calling the function: (new AnuncioRepository())->getListagemAnuncios() and the SQL for that is: return DB::select(' SELECT anuncio.id,…
-
3
votes1
answer273
viewsProblems with session Standard 5.3
I’m having trouble setting and picking up items from a sessão, in this case I am setting which page should mark in the menu as active. In the __contruct of mine controller I’m doing like this:…
-
3
votes2
answers1007
viewsBlade and Angular JS Incompatibility in Laravel 5
I’m having trouble using Angularjs along with Laravel’s Blade. After researching this site myself, I discovered that to resolve the conflict with Laravel the latest method is using the @{{}} in the…
-
3
votes1
answer508
viewsWhat is the difference between Request::wantsJson() and Request::ajax()?
In Laravel 4, I used to use the method Request::ajax() to know and the request was an XHR. When I started using the Laravel 5, I realized that it was being used more in the Request::wantsJson(). But…
-
3
votes1
answer324
viewsRequired_if with more than one field in Laravel 5.3
I have the following situation: I want one field to be mandatory only if the other two are null, if one of the other two is not null this field is no longer mandatory. I thought I’d use the…