Category "laravel"

Does the Laravel `increment()` lock the row?

Does calling the Laravel increment() on an Eloquent model lock the row? For example: $userPoints = UsersPoints::where('user_id','=',\Auth::id())->first();

Having multiple layouts in laravel

In my site I have seven different HTML Layouts. The reason i ended up having so many is because some pages had different headers/footers and some pages did not

Laravel page shows "This page isn’t working" instead of errors

My laravel project is standing on xampp on windows. Whenever I make a critical error (a typo for example) i should get an error, but instead I'm seeing "This pa

Cache clear probem in Larave

I have a problem. I am download project from hosting. now when I run the project this error shows. pic attached. I think this is cache problem, I clear cache, v

Customizing Bagisto and adding features

I want to develop an eCommerce website using laravel on a limited time-frame and i found out the package bagisto is developed for that purpose. However after do

What would be a proper way to handle tokens in monolith application?

I have a monolith web application powered by Laravel. Users access different forms and some of them have button on them that executes Ajax call to the back-end

How to disable CSRF Token in Laravel and why we have to disable it?

I want to see how I can disable CSRF token in Laravel and where I have to disable it. Is this good to disable it or not?

How to set a domain name with php artisan serve

I am new to PHP and Laravel. While virtualhosting with Wamp, I could specify the documentroot, servername and the port number - hence specifying the domain name

Laravel 7: External link not working in localhost

The external links of CSS and JS are not working when I try access my Laravel project from localhost by www.localhost/myproject this. But others porject run wel

401 Unauthorized only occurring on some pages in Laravel 8

Have created an app in Laravel 8, and have used the PHP artisan command "ui:auth" to create a login system, which works fine. However, when trying to use "auth(

How can I deploy my Laravel project to root folder in Hostinger with git?

I'm trying deploy my project to Hostinger with git, but I can't deploy direct to root folder (/home/uXXXXXXXX). The path in cPanel is directly to /home/uXXXXXXX

How to Mock the Request Class in Laravel?

I'm trying to test a function that depends on $request->all(); in a method. How do I mock the Request class so $request->all(); returns ['includes' =

Why do table names have to be plural in Laravel?

I noticed that whenever I create a class using database information in Laravel, the table name must be plural. Why is this?

Impersonate users with Sanctum

I'm implementing a simple impersonation system for Laravel with Sanctum. Earlier I used Tymondesigns/jwt-auth with Rickycezar/laravel-jwt-impersonate, but we re

Log file is not being written in Laravel 5.5

I have logging enabled by default on Laravel 5.5. The settings are: In config/app.php file: 'log' => env('APP_LOG', 'single'), 'log_level' => env('APP

Laravel - Implicit route model binding with soft deleted data

I am having a small issue. There are two user roles and one is a normal member and one is an admin. The member can delete a blog and they will not be able to se

Laravel Mix + BrowserSync infinite loading out of the box

Something's making my out-of-the-box Laravel project with browser-sync and the browser-sync-webpack-plugin installed to load infinitely on the browser-sync page

printing all running session variable in laravel 5.1

How do I print all running session variable in Laravel 5.1? I want to print all the running session variable. Currently I can retrieve single running session f

laravel automatically deletes server.php on php artisan serve

I am using laravel 5.6 on windows environment using php 7.2, (installed with xampp).After installing laravel the 'php artisan serve' command work but automatica

MongoDB/DocumentDB bson_append_array(): invalid array detected. first element of array parameter is not "0"

Recently I have migrated one of my projects (PHP 7.4/Lumen/Ubuntu 20.04) from MongoDB to MongoDB compatible AWS DocumentDB. Since the migration all the CLI Scri