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
- 
		3 votes2 answers868 viewsWhen trying to define column as Unique, error is generated by talking 767 bytesWhen I try to run a Migration on Laravel, the following error is generated: [Illuminate Database Queryexception] SQLSTATE[HY000]: General error: 1709 Index column size Too large. The Maximum column… 
- 
		3 votes1 answer5527 viewsHow to run the cron of Schedule:run on WindowsI created a cron that should check every minute that the value of the end date is less than the current one... if yes should update the status field of this table. class SetStatus extends Command {… 
- 
		3 votes0 answers789 viewsRegular expression in LaravelI’m not very good at regex but using the site https://regex101.com I was able to generate an expression that accepts: Do not accept special characters Can have up to 5 words separated by whitespace… 
- 
		3 votes1 answer363 viewsScript execution error in python in Laravel controllerCurrently my scripts work perfectly within Schedule that run at specific times within my server cron. The problem is occurring when I try to run the method inside the controller, this method… 
- 
		3 votes1 answer137 viewsAuthenticate in another PHP/Laravel applicationI am logged in this application PHP , in this application has a list of users as the image below: By clicking this button Log in I want to be redirected to a Dashboard that is in the same domain,… 
- 
		3 votes3 answers459 viewsHow to make two WHERE clauses inside a nested WITHI have the following code snippet $sectors = Sector::where('company_id', $id) ->where('status', '0') ->with('charges.levels') ->get(); and need 3 conditions Status of sector be it 0 Status… 
- 
		3 votes1 answer700 viewsJS does not work after running "npm run dev"Good afternoon, I am studying the Laravel 5.7 and was wanting to use a plugin called progressbar.js. One of the ways to install the plugin, is by playing the file progressbar.js right in the… 
- 
		3 votes2 answers887 viewsHow to receive a json in Controller and pass to Object arrayI am having the following problem, I need to take the Controller filtered objects to export to report. I’m sending by json using Ajax, but I don’t know if object is being sent to Controller,gave a… 
- 
		3 votes1 answer326 viewsCarbon diffInDays does not bring the negative value between two dates (only positive)$datNow = Carbon::parse('2018-10-23 18:40:11.000000'); $datSuspensao = Carbon::parse('2018-10-18 00:00:00.390176'); $diasRestantes =… 
- 
		3 votes0 answers38 viewsWhat is this error when running php Artisan migrateHello, I created an application with Laravel 5.7 and running php Artisan migrate shows this error What this error means and how to correct? Follow my.php database <?php return [ 'default' =>… 
- 
		3 votes2 answers290 viewsDoubt when performing SQL with Eloquent of LaravelI’m with a bug I don’t know why. I have in my controller the following Eloquent: $balances = BankUser::select(DB::raw('SUM(balance) AS total, created_at, DATE(created_at) AS total_at'))… 
- 
		3 votes1 answer130 viewsWhere do Eloqent Laravel Doesn’t WorkI have the following code public function getConsultaLocacao() { $consulta = LocacaoBanco::where('id',4)->get(); foreach($consulta as $v) { echo"aqui->".$v->datalocacao; } echo… 
- 
		3 votes2 answers2119 viewsDisplay creation date (created_at) in Laravel 5.5 postGood morning guys, I am very beginner in Lisbon and I have a small problem that I am not able to solve. In a post view, I need to display the date the post was created. In the database it would be… 
- 
		3 votes2 answers39 viewsHigh error when extracting dataMigrate does not give any error and also get popular table normally with Seed. But when I try to extract data from my database, it does not work. namespace App\Http\Controllers; use App\Todo; use… 
- 
		3 votes1 answer276 viewsWebservice error on Laravel 5.7I’m trying to create a WebService for Laravel using the symfony/process, if I run it in windows command it fills the log successfully (php artisan gerar:arquivo 12 param1 1000), but when I try to… 
- 
		3 votes2 answers165 viewsWhy is there a conflict of days in the Carbon API?I am developing an application. And I am using the Carbon API. But conflicts are happening from one month to the next. Today is July 31st. And the code I used was the following: $inicioMesAtual =… 
- 
		3 votes1 answer155 viewsRemove empty spaces Laravel + webscrapingI’m performing a webscraping as follows: $url = 'https://esaj.tjsp.jus.br/cpopg/show.do?processo.codigo=XXXXXXXX&processo.numero=XXXXXXX'; $client = new Client(); $crawler =… 
- 
		3 votes2 answers280 viewsHow to write this query using Eloquent?I need to write a specific SQL in a project Laravel but I can’t convert the SQL for the syntax of Eloquent, basically, I need to do this SELECT: SELECT * FROM `movimentacoes` WHERE nome LIKE… 
- 
		3 votes1 answer630 viewsHow to get hasMany relationship dataI have a table Grupo and a Topicos, where the group has many topics and this is my code: public function topicos() { return $this->hasMany('App\Topico'); } In my Controller is like this: public… 
- 
		3 votes4 answers1367 viewsSave dates in the right format (Orange)Using Laravel 5.8, I’m using dates. I can even show the date in the right format, using Carbon. Data de Validade {{\Carbon\Carbon::parse($p->dt_validade)->format('d/m/Y') }} However I can only… 
- 
		3 votes2 answers93 viewsLaravel 6 escaping html Blade templateI am displaying news registered in the database using Windows and Blade template, only that html is being escaped, I have tried several ways but I can not solve. My controller returning query result… 
- 
		2 votes2 answers1138 viewsImplementation Angularjs consuming data provided from Laravel using CORSI’m trying to create a web service in Laravel 4, which will be consumed by a mobile app using Angularjs. When I make AJAX requests with Angularjs, it gives Cross Domain error by being in another… 
- 
		2 votes3 answers2387 viewsUser-friendly URL for GET (search) form in Laravel 4My question is this:: I have a search form (GET), and would like to know how when running Submit send these parameters to the URL in a friendly way. Obs.: parameters are not mandatory. Form: {{… php laravel-4 laravel laravel-routes friendly-urlasked 11 years, 10 months ago Patrick Maciel 2,281
- 
		2 votes2 answers2341 viewsUpload and structure for image storage in LaravelI started to build a portal, using Laravel, which has as requirements: users, sites belonging to users and classified belonging to users. As each of these requirements requires images, I would like… 
- 
		2 votes1 answer1006 viewsHow do I use DOMPDF in Laravel 4 in conjunction with a BLADE view?I need to generate PDF report in Laravel 4. I have found several alternatives and I am in doubt about which best option: DOMPDF (alternate link) It seems very easy to use, since it’s our good old… 
- 
		2 votes2 answers317 viewsProblem with Seed Relationship between Category and Sub-Category in Laravel 4I don’t know how I do with my Seeds, I have 2 entities: Category and Sub-category. I want to be able to rotate Seeds and be able to register my Categories and after my Sub-categories, only that… 
- 
		2 votes1 answer1044 viewsReturn javascript result with controllerIt is possible within a Controller to return a javascript action and proceed with the controller script ? Example: Call to Login page: <li><a href="javascript:" link="{{ route('login') }}"… 
- 
		2 votes1 answer104 viewsError in an sql in the LaravelI’m having difficulty in an sql in the Laravel where I make a Join, but the error really happens is in the where, where the deleted_at is equal to null, recalling that the deleted_at is a timestamp.… 
- 
		2 votes1 answer3313 viewsHow to do a search with multiple filters as a parameter in the Laravel?I’m having a question about how to do a customer search with multiple filters. Example: nome cliente, tipo de cliente, status do cliente, endereço, cidade. Detail: all these filters are in different… 
- 
		2 votes3 answers1570 viewsLaravel Log In ErrorI’m having trouble logging in Laravel. See, it does not log the user, but also does not return error: auth.php return array( 'driver' => 'eloquent', 'model' => 'Cliente', 'table' =>… 
- 
		2 votes1 answer5625 viewsCreating Foreign Keys by Migration - LaravelI’m having trouble when I try to create foreign keys by Migration in Laravel. Watch my Migration!!! <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint;… 
- 
		2 votes1 answer414 viewsInstallation of Laravel 4 on remote serverHow to install Laravel 4 on a remote server via Composer? I searched extensively on the internet and found no convincing response that was in line with best practices or the philosophy of the… 
- 
		2 votes1 answer156 viewsHomestead Laravel Problem with Drive PostgresHas anyone here ever had this with Homestead and postgresql? My application is giving this error. Pdoexception could not find driver I’ve searched some places but nothing... I appreciate the help!… 
- 
		2 votes1 answer132 viewsHow to identify route in Laravel?I’m using a template for the menu and footer to be duplicated on every page. I put a if in the footer for when it is a given route it changes the content, but that is not what is happening, it is… 
- 
		2 votes1 answer647 viewsRead and write xlsm file in phpI have a very big hand problem: I have an xlsm file with macros to read, write and finally download. It is a 4 MB file with inline formatting and images. I’ve been using Phpexcel only I haven’t been… 
- 
		2 votes2 answers1415 viewsLaravel - Update all fields from a large tableI have the following problem... I am migrating a system, and in the same I own a client table This table has a field called "cli_password", in which the customer’s password To use Laravel… 
- 
		2 votes1 answer592 viewsLaravel validationI need to do a data validation coming from an XML, have as I use a Validation Request? Or Validation Request only for data coming from a form? 
- 
		2 votes1 answer297 viewsView PDF after AJAX call with TCPDF in Laravel 4After I save information in the database using the following code. $this->anamnese->create($input); I just call to test a code to generate a test PDF with the following code.… 
- 
		2 votes1 answer1552 viewscontact form with Laravel 5.1I need to create a simple contact form with Laravel 5.1, however, as I am more front-end, I would like some idea of what I can do to create this form, some websites even explain how it is done, but… 
- 
		2 votes1 answer2778 viewsCSS Blade LaravelI’m starting now with Laravel 5.1, I was left with a question regarding Lade. For example, I want to pass several CSS or JS files from the page in question using Blade notation. My main file looks… 
- 
		2 votes1 answer75 viewsIn Laravel, which file is indicated to use Macrotraits?In Laravel, some classes use the trait MacroableTrait. Through this trait it is possible to create definitions such as: HTML::macro('urlQuery', function () { // Faça alguma coisa aqui });… 
- 
		2 votes1 answer146 viewsCan the controller send an email?In a controller called activities, I have a method called reminder. This method, receives an id, looks for that activity based on that id and sends an email to the moderator of that activity with… 
- 
		2 votes1 answer788 viewsProblem with filters and routes in the LaravelHi. I am creating an api in the. And I have a problem with routes and filters for access. I have client, operator and administrator levels. I have routes that are common for client, operator and… 
- 
		2 votes1 answer92 viewsError in Gulp installationI am installing Gulp on my Windows 7 by the command gulp . But you’re giving me the following mistake: [11:21:03] Error in plugin 'gulp-bower' Message: Failed to execute "git ls-remote --tags… 
- 
		2 votes2 answers522 viewsRecovering value in the pivot table as property of a relationship partI have the relationship manyToMany amid Grupos and Usuarios and a pivot table grupo_usuario which stores the keys and an extra field aprovador, boolean, which serves to indicate whether the user in… 
- 
		2 votes2 answers485 viewsExtract only extensions specific to a ZIPI am developing a system where in some part of it the client can send a file ZIP containing only images. I’m willing to do it in a way that I can extract from this ZIP only files that contain… 
- 
		2 votes2 answers108 viewsWhat is the "array" option for in the app/config/Session.php?I know that in Laravel 4 we can configure various ways to save session data. These are optional session storage mechanisms. Among them we can select memcached, database, cookie, apc and file, which… 
- 
		2 votes1 answer6661 viewsGenerate token from string and check generated tokenBasically, I need something that works similar to $hash = Hash::make('string') and Hash::check('string', $hash) but that does not produce as big a result as (60 characters). or $hash =… 
- 
		2 votes1 answer159 viewsHow to define routes in Laravel that only work in a development environment?I would like to know how to define routes in Laravel that work only in development environment. I believe that this can be useful to facilitate the debugs. I want to be able to separate some routes… 
- 
		2 votes1 answer878 viewsWhy does creating the model not create Migration for me?I’m starting at Laravel 5 and then this tutorial. By creating the model php artisan make:model Tarefa he does not create me to Migration in database/migrations/ as it would be supposed, someone…