I have a column input named Address, and how to check, if user input like null, ‘null’ and ” , the return response will be error. I have make it, but it not working. This is my code: Answer You may use the empty function, which would return FALSE if var exists and has a non-empty, non-zero v…
Tag: laravel
Laravel keep chmod storage folder
When i access view in my laravel application, why is it always showed this error every 1 minute: file_put_contents(/home/vagrant/Code/myproject/storage/framework/cache/data/db/59/…
Custom login and registration with auth laravel 5.7
I’m trying to create the first project with Laravel 5.7. In this project I have three different areas with three different login (ex. Login for users, login for admin, login for technicians). Now, I would like to customize the first login (url, html, input, class, db table, db column ecc…) but I d…
How can I store random_bytes in a database in PHP?
Inside of my migration I have a string column named encryption_key which looks like this: I have a Controller that uses a trait to generate the encryption commands. The trait looks like this so far However, upon testing this I receive this error: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string…
Gitlab webhooks not working due to shell script permission
Using laravel 5.6. I’m trying to set up a webhook on gitlab, to make a git pull on push events. I’ve created a post route, added controller and method, that launches a shell script: Shell script itself contains just a one line: But in gitlab’s request details, i see an error after a push: I …
Function name must be a string in laravel authentication login
There was a problem while doing authentication operations on the laravel admin. FatalThrowableError (E_ERROR) Function name must be a string Admin Controlller: AdminLogin Controlller: Routes: Answer The answer might not be relevant to this specific question though, but at least may be able to point someone in…
Create a process to dynamically listen, work or monitor queues in laravel
I’m dead stuck in a problem where I have to dynamically create queues and those queues should start to listen to all the active jobs assigned to them. “Using general queue” is not feasible in my case …
Laravel @extends(‘layouts.app’) not working on some pages
@extends(‘layouts.app’) does not work on some of my web pages. it just shows the content without the layout. why is this happening? I already tried making a new layout folder and calling it but still some pages still doesn’t show the layout. both show.blade.php and create.blade.php doesnR…
Laravel / League Fractal returns an empty array instead of empty object
I’m having a problem with Fractal library. I’m using Spatielaravel-fractal library which is just wrapper for Leaguefractal. So… I want to return an empty object instead of an empty array. $this->null() always returns [] after generation and I want to return {}. Tbh I want to have 2 functi…
Spatie/pdf-to-image get number of images always returns 0
I’m using the spatie/pdf-to-image with laravel to create thumbnails of uploaded pdf files. What is weird is that the code was working at one point now it isn’t. $pdf->getNumberOfPages(); always returns 0 no matter how many pages the pdf contains. This is the constructor in the Spatie Pdf class.…