Questions tagged key

Explore the latest questions and answers asked by our top developers.

Updating database session key with created session key on login?

I am creating a login form in laravel and want it to be secure. I keep reading how session keys need to be unique and am a little bit confused. I assume they mean the value of the key when they say this. For example {user_id: 8fjf8flfdkdjf} where 8fjf8flfdkdjf is a randomly generated key on […]

By Johnathan M
Published
Categorised as authentication, key, laravel, php, session Tagged , , , ,

What is the session key?

I am creating a login form in laravel and want it to be secure. I keep reading how session keys need to be unique and am a little bit confused. I assume they mean the value of the key when they say this. For example {user_id: 8fjf8flfdkdjf} where 8fjf8flfdkdjf is a randomly generated key on […]

By Johnathan M
Published
Categorised as authentication, key, laravel, php, session Tagged , , , ,

is this what is meant by setting a new secret key when logging in?

I am creating a login form in laravel and want it to be secure. When I login I update the existing key with a new key in the row and use it as a means of selecting info / updating info ect. I am not an expert at programming but below is my code. DO […]

By Johnathan M
Published
Categorised as authentication, key, laravel, php, session Tagged , , , ,

How to access item in a Collection

I have two collections. First Collection is all descendants (not children) from root item, flat structure, in other words, ALL items in my DB in flat organization: $descendants = $root->getDescendants(); I go through this collection using foreach: foreach ($descendants as $key => &$item) {} For each item, I do some magic, but then, I need […]

By SubjectX
Published
Categorised as collections, foreach, key, laravel, php Tagged , , , ,

Laravel 8 Rate Limiter cache keys

We’re using Laravel (8) rate limiter and running into constant duplicate key violations in our cache table. Postgres is throwing fits because of the constant attempts to write to the cache with the same key. We’re getting duplicate key value violates unique constraint "cache_key_unique" errors, and it looks like every time (and with everyone) it’s […]

By DOlson
Published
Categorised as caching, key, laravel, limit, unique Tagged , , , ,

SCAN not return its last cursor value in laravel

I am trying to get all the keys from Redis with matched string using Redis SCAN command (as a replacement of KEYS command)in laravel but it returns an array only without its cursor value. $redis = Redis::connection(‘default’); $keyList = $redis->scan($iterator,’IN_S*’,1000); Output: Array ( [0] => IN_SMASTER:56767#23 [1] => IN_SMASTER:13#83 [2] => IN_SMASTER:56767#10 [3] => IN_SMASTER:56767#0100 […]

By Vinay Singh
Published
Categorised as key, key-value-store, laravel, php, redis Tagged , , , ,

How to merge child key pairs to parents in Laravel models

Old PHP user here but new to Laravel, I need help(answers or link to related solution)… If I have a relation model(or collection, I get confused here)… $data = MyData::with(‘new_data’)->first(); resulting with… data = { a: 1, b: 2, new_data: { c: 3 } } Is there an easy eloquent or collection function to merge […]

By Jacobski
Published
Categorised as eloquent, key, laravel, laravel-models Tagged , , ,

Hi i am posting youtube url in my fileds in admin pannel i am getting

{ "error": { "code": 403, "message": "The request is missing a valid API key.", "errors": [ { "message": "The request is missing a valid API key.", "domain": "global", "reason": "forbidden" } ], "status": "PERMISSION_DENIED" } } Source: Laravel

By anitha cheekuri
Published
Categorised as api, key, laravel, php, youtube Tagged , , , ,

Laravel migration: adding foreign key to the same table where ID is a string

I’m trying to make "categories" migration, where each category refers it’s parent category by ID in the same table. Migration: Schema::create(‘categories’, function (Blueprint $table) { $table->string(‘id’, 36)->primary(); $table->string(‘parent_id’, 36)->nullable(); $table->foreign(‘parent_id’)->references(‘id’)->on(‘categories’); $table->string(‘name’); }); But i’m getting next error: IlluminateDatabaseQueryException : SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table categories add constraint categories_parent_id_foreign […]

By Develeone
Published
Categorised as key, laravel, migration Tagged , ,

Laravel Eloquent Topclaudy/Awobaz: multiple relationship with 3 foreign keys

I am developing a project in Laravel and have to use the package Topclaudy/Awobaz Compoships since laravel does not support composite keys I have three database tables **(schools, programs, degrees) ** which are in a One-To-Many relationship to a fourth table called school_programs They are joined by three conditions. How do I model this relationship […]

By Bridges MP
Published
Categorised as composite, composite-key, eloquent, key, laravel Tagged , , , ,
1 2

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq