Category "laravel"

Laravel Migration Error: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

Migration error on Laravel 5.4 with php artisan make:auth [Illuminate\Database\QueryException]

Laravel: Why is my variable not being set while it's in the construct function of the controller?

class Controller extends BaseController { use AuthorizesRequests, AuthorizesResources, DispatchesJobs, ValidatesRequests; private $host; private

Remove categories with all childs derived from parent category

I want to remove all related child categories from parent categories. I think I need a recursive function to solve this. Here is my attempt: public function de

Detect emoticons in string

I found that you need PHP 7 and MySQL 5.5 to use emoticons in a string that you want to upload to the database. I don't have these specification on my server s

I want to make where clause inside to select DB::raw in laravel

I have two tables biodata_wni and demographics, I want to count data where column akta_kwn in biodata_wni has value 1 and also the count of akta_kwn in biodata_

Saving Data from Laravel Form in Bootstrap Modal

i have a bootstrap modal dialog which use laravel form to register a user. Here's the code: <div id="addPenggunaModal" class="modal hide fade" tabindex="-1

SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: 'column_name' in Laravel

Laravel Multiple Data Insert Error SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column 'unit_id' at row 2 (SQL: insert into p

Laravel str_random() or custom function?

Is the Laravel str_random() function random enough so that I can use it for IDs? For example: str_random(32); This produces a random string of length 32 mad

Laravel env('APP_URL') is not returning the correct value for localhost

When trying to retrieve the APP_URL from the Laravel config it returns the wrong URL for development only. My env file has the following: APP_URL=http://127.

Cannot load imagick library

I have installed the imagick from here (ImageMagick-7.0.3-1-Q16-x64-dll) and the dll (TS 32 bit) from here. And also copiend the CORE_RL_* to the C:\xampp\apach

Laravel Gates using model and returns "Using $this when not in object context" Line 28 of AzureUser model

Im trying to create a Gate in Laravel. The idea is to check if one of the roles is present on an AzureAD access token. So far I have this Gate::define('admin_cm

Redirected to login after refreshing page in nuxtjs and laravel sanctum

i have a problem with Nuxt SSR mode in production auth with Laravel sanctum login success but when refresh any page, redirecting to login page and logout !!!

add uri parameter to Route name in laravel

I'm working on a Laravel project, and I made a simple CRUD system, but I have a small problem to generate the URL system in my project, I made a Route::macro

git ignore .env files not working

I have a laravel project. In the root directory are these 4 files: .env .env.example .env.local .env.staging I have a .gitignore file, and I'm listing the

How to switch Vue.js to production mode in Laravel?

Since Vue.js is comes already installed in Laravel, I'm not sure how to set it to production mode. When I launch my website I get the message in console: Y

How to trigger 'joining' in presence channel?

I am trying to use a presence channel to see users come and go. With this purpose, as documentation recommends, I wrote this code. And I receive this. But h

Why do I get null auth user inside middleware?

The global middlewares, the ones which are run for every request on every route: protected $middleware = [ \App\Http\Middleware\CheckForMaintenanceMode

"Database hosts array is empty." after deploying Laravel project on AWS Elastic Beanstalk

I deployed my project to an AWS EC2 instance using Elastic Beanstalk. I used this tutorial https://www.youtube.com/watch?v=ISVaMijczKc as a reference while depl

"Call to undefined function str_slug()" in Laravel 6.0

I've upgraded my laravel 5.8 project to 6.0. It has upgraded successfully but when I'm trying to run the project or installing another package to my project it

Laravel UUID generation

I am trying to generate a UUID (not as primary key, just generate one) with the laravel-uuid package. The docs are pretty straightforward, so according to the r