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
votes2
answers506
viewsAutoload of Models in Laravel 5.1
Good night I wonder if in Laravel 5.1 there is a way to autoload, both in Models and Controllers? In Laravel 4 to create an instance of a Model, simply call the Model, thus: $user = new User(); But…
-
2
votes1
answer1133
viewsHow to authenticate multiple user groups in Laravel 5?
I am trying to create an environment in Laravel 5 where there is the customer access area (Front of the Store) and the administration area of pages, products, etc. (CMS), but the problem is that I…
-
2
votes1
answer987
viewsHow to redirect to auth/login in Laravel 5.1 if visitor is not logged in?
I am using Laravel 5.1 native authentication but when accessing a protected route the system does not redirect me to the login screen, instead it shows me the message "You don’t have permission to…
-
2
votes2
answers238
viewsError installing Laravel: Package not available in stable version
I’m strictly following the indicated in the Laravel documentation to make your installation: composer global require "laravel/installer=~1.1" However, after a long delay comes the following return:…
-
2
votes1
answer207
viewsLaravel 4.2 - 405 Method Not Allowed
I have a route that was working normally and stopped working for no apparent reason. It has the following configuration: Route::put('/clientes', 'Clientes@update'); The mistake I get is: Method Not…
-
2
votes2
answers914
viewsArtisan Laravel not installed
I installed the Laravel with Composer all working ... I use commands like laravel new projeto, but I use a command like php artisan list he informs that the Artisan command is not recognized... How…
-
2
votes1
answer520
viewsPrevent improper access to the Restful API
I am developing a Restful API with Laravel PHP that will be consumed by an Android application, the API is consumed only by the application, there is no web system. I am learning Restful, and during…
-
2
votes1
answer2115
viewsReturn Json with related data - Laravel
I am creating a REST API but I stumbled upon this issue in which I cannot imagine a solution. In my database I have 2 tables; Table 1 - General product data such as name, code, sku and description…
-
2
votes1
answer278
viewsHow to update the pivot in LARAVEL 4 using the UPDATE method?
I have two models that are linked, through the belongsToMany, a relationship table N:N. So the structure is arranged as follows: class Permissao extends Eloquent{ public function niveis() { return…
-
2
votes2
answers820
viewsAn application for multiple customers with Laravel
I’m creating a multi-client web application project using Laravel. In my project this application would have several databases, one for each customer. Searching the internet, I saw that with the…
-
2
votes1
answer788
viewsCreating and using Libraries in Laravel 5.1
I am new to Laravel 5.1 (I come from Codeigniter) and I have my own libraries that I would like to implement in it. In Codeigniter, we have the folder libraries where I can play all my libraries…
-
2
votes2
answers355
viewsTokenmismatchexception after any ajax error on Laravel 5.1
I have been working with Laravel for a short time and am having a problem when using ajax requests. When my application returns any error and I try to send another request, Laravel sends me this…
-
2
votes3
answers1872
viewsError running Composer update while trying to install package scafold in Laravel 5.1
I’m trying to install the package scafold in Laravel 5.1 only when I run Composer update it shows me an error. C: xampp htdocs sites stock>Composer update Loading repositories with package…
-
2
votes1
answer232
viewsWhy should I use File::copy, if PHP already has copy?
I am using the Laravel in various projects that I use. I needed to copy a particular file from one location to another, and I saw in the Laravel documentation that I should use File::copy(). Out of…
-
2
votes1
answer2455
viewsFolder for Models Laravel 5.1
Good morning, different from Laravel 4, the version 5.1 creates the Models directly in the folder App, wanted to know if it will influence something if I create folders to better organize these…
-
2
votes1
answer254
viewsModel, View and Controller "Multipurpose" - Laravel 5.1
Good morning, I have in my application 10 different tables, but it has the same structure... id | nome | descricao. For each table I have in the Model, the Controller and the Views registration,…
-
2
votes1
answer1996
viewshow to configure the eclipse IDE to fully read a 5 Standard project
When you create a project with Composer and import into the eclipse Workspace some files do not appear as . env . gitignore or . json alguem knows how to configure the eclipse to be able to read and…
-
2
votes3
answers445
viewsHow to make the relationship of an extra field (pivot) in belongsToMany
Currently I have the following situation: 1 User can belong to several municipalities Within that relationship - municipios_usuarios - I also need to save who made this relationship, ie usuario_id…
-
2
votes1
answer781
viewsLaravel 5 improve filter
I created a filter in my view index, when I put something inside one of the filter inputs enters ifs but I think it’s not good this way, someone knows somehow better? public function index() {…
-
2
votes1
answer757
viewsModelfactory is not generating $Faker data for some tables
I’m using the ModelFactory standard of Laravel 5 some time ago, and everything was going ok, but from a few days to here stopped generating data from the library faker for some tables, although…
-
2
votes1
answer411
views@Yield does not display content
I am learning Laravel 5.1, I came across a mistake while using the @yield. I can’t move the contents from another archive to the archive where I want to include. Next I have the content I want to…
-
2
votes2
answers2555
viewsHow to Type in a Select?
How can I make a select work also as a search field? Type, the client type as if he were typing in a input text for example, and the options of select are being filtered according to what he typed.…
-
2
votes1
answer357
viewsDoubt Laravel 5 - Libraries and Functions
<?php namespace App\Http\Controllers; use App\Http\Requests; use App\Http\Controllers\Controller; use App\ListaProduto; use App\Produto; use Input; use Illuminate\Support\Facades\Request; use…
-
2
votes2
answers2912
viewsWrite to two different tables using the same View
I am registering suppliers, and I need to record it in a table and your address in another. I use a single view suppliers. to fill in all the data. How can I separate this data to save it to their…
-
2
votes2
answers1376
viewsHow to publish multiple Laravel applications on Shared Server?
I have two independent application made in Laravel would like to host them on the same server, in separate directories. I searched extensively for documentation and forums, and I was able to make…
-
2
votes1
answer563
viewsLaravel - How to Change Default Folder for New Projects
New projects created using the Laravel installer go to C:\Users\MyUser\. For example if I use the command laravel new MyApp Laravel will be installed inside the directory C:\Users\MyUser\MyApp. How…
laravelasked 8 years, 9 months ago Kelvym Miranda 349 -
2
votes1
answer1061
viewsArtisan command not to lose data from database
Hello I am starting to work with Laravel 5 and I am having a problem when I run the migrate commands the data is lost in the database, this is expected? the command php artisan migrate works on the…
-
2
votes1
answer460
viewsRequire Once / Include no Laravel
I’m trying to include a file on a page on a site made in Laravel. The file and page are on different servers. How can I do that? I tried with include and gave the following error : include():…
-
2
votes1
answer353
viewsIs there any way to run Laravel on the command line in interactive mode?
In PHP, I know it is possible to rotate it interactively on the command line, which is via the command php -a. Even better would be using the library psysh. But when it comes to not just running…
-
2
votes3
answers1586
viewsComposer does not install packages
I recently installed Ubuntu on my machine and am preparing the environment to work with Laravel. Everything is working except that I can’t create the Laravel project when I run command composer…
-
2
votes1
answer849
viewsLaravel - Return HTML or JSON in the same Method
I’m starting with Laravel, seeing from Rails, where to return a JSON I just put . json in the url, the return processing is obviously in the Controller. My question is how to do something like…
-
2
votes1
answer1823
viewsError Accessing Site in Earth Hosting
I transferred a website to network in an Earth hosting and when trying to access it displays the following error: Not Found [CFN #0005] I’m talking to the support - horrible, by the way (Neto) - and…
-
2
votes2
answers325
viewsHow can I execute this query with Laravel 5?
How I would perform the following query in Laravel 5: SELECT *, (SELECT COUNT(`anuncios`.`cat-id`) FROM `anuncios` WHERE `anuncios`.`cat-id`=`categoria`.`cat-id`) AS `cat-total` FROM `categoria`…
-
2
votes1
answer1123
viewsData Management System Log System
I am developing a data management system in PHP Laravel 5. In this system I want to put a Logs. 1 - Laravel has some library that facilitates this system ? 2 - If Laravel doesn’t have the best way…
-
2
votes0
answers48
viewsProblem with foreach, Aravel is not recognizing the model Indexes
Index Controller: <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use App\Http\Controllers\Controller; use View; use App\Indexes; use…
-
2
votes1
answer1882
viewsPick up specific columns with Laravel querybuilder
Consider that my table in DB has many columns. However, for a specific query I do not need all of them. As I would in Laravel ( using both Eloquent and Querybuilder to pick up only the columns I…
-
2
votes1
answer867
viewsLaravel session does not work on another page
I am working on a project with Laravel, in it I created a session variable that takes a parameter of the url as follows: if(!empty(Input::get('lang'))){ $lang = Input::get('lang');…
-
2
votes1
answer403
viewsHow to know if a particular column exists in a table in Laravel?
I wonder if there is any way to know if a column exists or not in the Laravel. For example, I want to sort data from the query string. If the value "column" exists in the table, then I sort by this…
laravelasked 8 years, 6 months ago Wallace Maxters 102,340 -
2
votes1
answer904
viewsSingle record with 2 fields verification - Laravel 5.1
I have a table with columns id, nome, descricao and tipo. In my Request I have: 'nome' => 'required|unique:edificacoes' So far so good, I can not register anything with the same name, but as I…
-
2
votes1
answer86
viewsLaravel Template Help!
I have two Blade.php files and I’m not being able to see the content in the browser. @extends('layouts.index') @section('content') @parent <div class="container"> <div class="row">…
laravelasked 8 years, 6 months ago Douglas William 321 -
2
votes1
answer175
viewsError while uploading site
Guys I just uploaded a site of mine made in Laravel 5.2 with Pho 5.6 locally. I went up to a shared hosting in Locaweb that I have. I configured PHP 5.6 correctly and I went up the site here giving…
-
2
votes2
answers2873
viewsLaravel - How popular a combobox in the 'on load' event of a view (Blade)
I need to popular a combobox with database data, but this fill should occur while loading the view. Since the view is not the right place to write code, how to feed the combobox? Through a method in…
-
2
votes1
answer127
viewsIs it possible to customize the return of the Laravel validation when using Request?
When I use a request post and check the data using Request in Laravel 5.2 via ajax, the data is automatically returned to javascript. I wonder if there is a way for me to capture and customize this…
-
2
votes1
answer785
viewsWith creating a Request with namespace in Laravel
I tried to create a Request with a subnamespace in Laravel 5, but to no avail. When I turn the remote php artisan make:request Temp\OsRequest, instead of creating a file called OsRequest inside a…
-
2
votes2
answers6064
viewsHow to pass parameter on a route?
I have a simple test routine, which is not working in the final part. The idea is to query a Mysql database and compose a page with the result, which works correctly. Clicking on a link from a line…
-
2
votes1
answer116
viewsHow to create a project based on Laravel to be the basis of others?
My idea is to create a base administrative panel, where I can use the next sites, without having to copy and paste. At the base I have only control of users and menus, the rest I create packages and…
-
2
votes1
answer140
viewsAdjustable and angular API
I am trying to make a request using angular connecting to the REST API built in Laravel. XMLHttpRequest cannot load http://localhost:8000/rest/v1/entidades/licitacoes. No…
-
2
votes1
answer106
viewsHow do I use the same app/config/local/database.php configuration when I’m running in enviroment "testing"?
In the Laravel 4, we have three types of environments that can be defined: local, production and testing. I even published something related to the configuration of the environment local here in :…
-
2
votes1
answer180
viewsHow to integrate Kcfinder with Laravel?
I am making a form where the user can insert an image along with the text. Searching the internet I found Kcfinder that does exactly what I need. I integrated it with Ckeditor and so far so good.…
-
2
votes1
answer66
viewsSelect dates based on the total sum of a given column
Good night. Based on the example registration attached, I would have to select all dates that are equal and are in the same restaurant and the sum of the amount is > 10, because I need to disable…