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
-
4
votes1
answer381
viewsWhy aren’t my custom error pages being called?
My custom error page is not being called. OS: Linux Ubuntu PHP 7 / Laravel 5.5 I already created the folder "Resources/errors" and in it the file "404.blade.php" I already gave permission in the OS…
-
4
votes1
answer4692
viewsLaravel no servidor Locaweb: Unexpected Character in input: ' (ASCII=92) state=1
I’m staying at the Locaweb and is making this mistake. Warning: Unexpected Character in input: ' (ASCII=92) state=1 in /home/Storage/a/B7/B3/reciclaoleovegetal/public_html/public/index.php on line…
-
4
votes2
answers10962
viewsLaravel 5.3 Trying to get Property of non-object
good morning! I followed what is said in this tutorial to fill values in a view: https://www.tutorialspoint.com/laravel/retrieve_records.htm And I did the same scheme on my controller: public…
-
4
votes1
answer13616
viewsHow to create a cron in Laravel?
I have to create a Cron on Laravel to send emails every 24 hours. I’m supposed to upload data from the bank. So after a query in the database cron should send the email with the query data.
-
4
votes1
answer1609
viewsRun an Laravel Schedule every minute?
I’m using the Laravel 5.3 and would like to perform a task every minute, within the task I will put some checks, the question is to make it run every minute. I did the following in the Kernel App:…
-
4
votes1
answer1794
viewsSave multiple attributes to the same object in Laravel
I have an immovable table other of attributes and created an immovel_attribute table since an immovable can have several attributes. I created the models Immovel and Attribute, need to create a…
-
4
votes1
answer343
viewsGettype() Laravel
I’m trying to get the type of the columns of the tables of my BD, and how to use PHP with the Laravel I tried to use the GetType to pick up the guys and show on view. But the code is only returning…
-
4
votes2
answers2451
viewsChange storage location in Laravel 5.4
The current storage location of the Laravel is /Laravel/Storage/app/public. How do I change to /Laravel/public. I tried to edit filesystems.php but was unsuccessful: Controller store function:…
-
4
votes1
answer7792
viewsPDF Generator with Laravel Framework?
I need to do the snappy generate reports from BD. But for that I needed examples of using the snappy, in the documentation of github there’s an example, but that example didn’t help me. I needed an…
-
4
votes1
answer211
viewsAjax locks the computer
Analyze the code below function update(){ $.ajax({ url : 'http://localhost/sistema', type : 'get', dataType : 'json', success : function( data ){ console.log('Mostrar dados: '+.data.dado); } }) }…
-
4
votes1
answer145
viewsShould I feed my website through the API or not?
If I am developing a site that has an integrated API, for example Laravel, I own a site and an API in the same project What is the best way to feed the site? I must create a controller which will…
-
4
votes1
answer483
viewsWhen and where to handle exceptions with Laravel in developing an API
I’m having some doubts when it comes to handling errors in an API. We should always treat an Exception? It would be correct to return a message like the one below? Return: { "success" : false,…
-
4
votes2
answers851
viewsSort items from a Collection from a preset value
I have a Collection of the Eloquent and I would like to order it through two fields at the same time being one of them a predefined value. Ex.: this one Collection has several objects of the type…
-
4
votes2
answers1543
viewsWhat is the purpose and how to use Broadcasting in Laravel?
The version 5.3 of Laravel has some news, as the Broadcasting, for example. I read the documentation, but I could not understand very well on the subject. I saw that it has some relation (whether…
-
4
votes1
answer16148
views500 | Server Error - Laravel
I created a new project in Laravel with the command laravel new server. I updated the Poser, inside the same, with composer update. However, when accessing the http://localhost:8000/, it returns me…
-
4
votes1
answer1227
viewsHow to filter by state cities in Laravel?
I made a filter in the Laravel and it works perfectly but nevertheless brings all the cities. It does not bring the specific cities of that state. I do not know if it is this filter that has to pass…
-
4
votes1
answer527
viewsBlade OR syntax within Laravel Collective input value
The following input works normally, but when I pass it to the syntax of Laravel Collective, says that the variable $servico does not exist. It does not exist at all, so it should show the value…
-
4
votes2
answers397
viewsHow do I search with Query Builder in Laravel?
I need to display the name of the doctor who requested a patient report, however, with Laravel I tried to show this information on View thus: {{laudo->paciente->medico->nome}} Then I…
-
4
votes1
answer316
viewsFormat array of dates
I have an Laravel application with the following code: private function todosRegistros($id, $colunas = ['data', 'nivel']) { return Leitura::select($colunas)->where('estacao_id', $id); } public…
-
4
votes1
answer985
viewsPage number with DOMPDF and LARAVEL
How do I place the number of each page with domPDF? I use it with the Standard. Example: Page 1-4, Page 2-4, Page 3-4 and Page 4-4; My function to fetch database data: public function print($id) {…
-
4
votes1
answer1269
viewsRegex for repeat numbers on CNPJ
I have the following regular expression: regex:/^\d{2}\.\d{3}\.\d{3}\/\d{4}\\-\d{2}$/ I can validate for that, but not for repeated numbers. I want to apply within this regex, a form that does not…
-
4
votes1
answer221
viewsMultiplication and summation of dynamic inputs
Note: Developed with Laravel 5.7. Note 2: This is the view from "New Request". The form will dynamically receive the products according to their previously registered items. Until then ok! The user…
-
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 =…
-
4
votes2
answers299
viewsSelect Laravel Entering Next Record Alone
Good evening, I have a project in Laravel and I’m having the following difficulty: I have a controller that retrieves data from my database, has a variable that receives string and this string…
-
4
votes2
answers192
viewsAdd and Remove Field through Checkbox
I have a form where I select colors for the page, and in it there is a checkbox with the option of usar padrão do site, the moment I click on this checkbox it removes the field, but when I uncheck…
-
4
votes2
answers643
viewsCreate and edit data from a table with Laravel relationship
I have a table called agenda, among the fields of this agenda it is possible to add several responsible for it, which are the users registered in the system, for this there is a field of type…
-
4
votes2
answers583
viewsWhat makes "group by 1" and why it causes errors in Laravel
I wonder what the group by 1 does in the MySQL ? I’m curious because I have a very complex query on MySQL and it works great, only I’m trying to use it in Laravel and I get an error in the return.…
-
4
votes1
answer157
viewsUpdate Fields Using Checkbox - Laravel
I have a User Registration form, where I make available the options to select several options in Checkbox. Registration - Sports Practice: Football, Volleyball, Swimming and etc. (Users can select…
-
4
votes1
answer3565
viewsHow to get the month in Portuguese using Carbon?
I’m having doubts on how to get the month’s value in full in Portuguese using the API of Carbon using the framework Laravel. Initially, I built this logic using PHP. if($data->month == 1){ $mes =…
-
4
votes5
answers583
viewsHow to sort json in php
I have the json example I’m using below: [ { "unidade": "124", "bloco": "Bloco B" }, { "unidade": "21", "bloco": "Bloco A" }, { "unidade": "94", "bloco": "Bloco A" }, { "unidade": "31", "bloco":…
-
4
votes2
answers1661
viewsLaravel: Cannot add Foreign key Constraint
I have two tables, the table users and empresas, with Model User and Empresa respectively. A user registration can manage a company, and for that, I need to define which id the user will access in…
-
4
votes1
answer94
viewsRepositories can manipulate and "transform" data?
I’m implementing two video service Apis (Youtube and Vimeo), and because it’s a layer of data, I thought it was ideal to create repositories for each one, with the API being the "source" of the…
-
4
votes1
answer36
viewsSort distance record based on latitude and longitude - Laravel
I have a table companies who has a one to one polymorphic relationship with addresses I have the parameter of latitude and longitude and I would like to order the Commissaries to the distance of the…
-
3
votes2
answers1735
viewsDate being recorded wrong in m-d-Y bank instead of Y-m-d
I set the date format for viewing to "d-m-Y", while the recording format is from the "Y-m-d" bank". However at the time of recording in the database, something happens and the data is going in the…
-
3
votes1
answer458
viewsError in DOMPDF library constant
I installed the dompdf package on laravel4, using Composer. However, you are giving the following error when trying to create the object: Use of Undefined Constant DOMPDF_TEMP_DIR - assumed…
-
3
votes3
answers3257
viewsProblem with Laravel date
My problem is in the date conversion, see: echo date('Y-m-d', strtotime(Input::get('data_evento'))); echo of Input::get('data_evento'): 14/02/2014 echo of date('Y-m-d',…
-
3
votes1
answer759
viewsRelationship in Laravel/Eloquent ORM
I have a problem. I need to return the values of a relationship, however, presents the following error: ErrorException Undefined property: Illuminate\Database\Eloquent\Collection::$fileServico My…
-
3
votes2
answers1433
viewsLaravel: View and Subviews
Someone knows how mine layouts.default can load multiple views whenever they are called. For example I want to call views from menus and the file menu.blade.php has to receive data too.…
-
3
votes2
answers479
viewsSoft Delete and relationships in Laravel 4
I wonder if there is any way to use soft delete but check if there are relationships/data/records linked to the record that will be deleted before deleting. Of course, using only Laravel himself.…
-
3
votes2
answers263
viewsLaravel Belongstomany
I have a user table that makes relationship with profile belongsTo, and the profile relates to area items belongsToMany , and area items makes relationship with area belongsTo, he is bringing my…
-
3
votes1
answer180
viewsHow and when to create Packages in Laravel 4?
I have been researching and thinking about a subject for days and I still don’t understand how to do/use/start: Setting Package: Books (crud) Package: Authentication module (users + profiles + login…
-
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
votes3
answers2496
viewsProblem with special characters
I’m starting to learn about Laravel 5 and I’m having a problem, every text I write with special characters is converted to ''. I have tried every type of charset configuration from ISO-8859-1 to…
-
3
votes1
answer271
viewsLicensing of a Software
I am developing a system that uses Apache server, Laravel, Mysql etc. Well, I would like to license this system, and my question is whether I can do this and if so, what kind of license should I…
-
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
votes1
answer1005
views -
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
votes3
answers593
viewsMove Cursor to Next Form Field
I have a form with various inputs, combos and etc. How can I make so that when the user selects an option in the combo the cursor already jumps to the next form field? Also make sure that when the…
-
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
answers1138
viewsPresent summary content in Laravel 5.1
I have a controller that performs a paged query: $noticias = Noticias::orderBy('created_at', 'desc')->paginate(4); However, one of the returned columns is the content. The column in question has…