Comments (3)
Hello Nasir!
Something similar happens with Comment.php in the function setUserIdAttribute on line 82. May be you should revisit the insert demo on CLI, while having a DB prefix and check some bugs. Most likely you did not use a prefix and these bugs remained.
from laravel-starter.
Hello Nasir!
I found the root cause of this problem.
In the UserTableSeeder, you did not use the ID. Now, I created one like this for all fake/default users:
// Add the master administrator, user id of 1
$users = [
[
'id' => '1',
I repeated the same for PermissionRoleTableSeeder like this:
// Create Roles
$super_admin = Role::create(['id' => '1','name' => 'super admin']);
$admin = Role::create(['id' => '2','name' => 'administrator']);
$manager = Role::create(['id' => '3','name' => 'manager']);
$executive = Role::create(['id' => '4','name' => 'executive']);
$user = Role::create(['id' => '5','name' => 'user']);
The same thing I did for UserRoleTableSeeder like this:
User::findOrFail(1)->assignRole('super admin');
User::findOrFail(2)->assignRole('administrator');
User::findOrFail(3)->assignRole('manager');
User::findOrFail(4)->assignRole('executive');
User::findOrFail(5)->assignRole('user');
Then I was able to insert the Demo data.
The above bug got fired because in my database, all the ID for every record starts with the number 2 and it continues with the next record by adding 4. The next one is 4, 8, 12, 16, 20, 24, etc.
I do not know why this adding of 4 to each record id is hapenning. It looks like you use mysql and I use MariaDB (latest). So the creation process is different.
After finding this, I have removed the temporary tracking of this source of bug with $author = "Author";, as mentioned above.
Thus, everything works fine after addition of correct id in the Seeders.
It is upto you to change it and modify the demo data. If not, please close this issue.
from laravel-starter.
fixed the issue. thanks for reporting.
from laravel-starter.
Related Issues (20)
- Fix view cache issue HOT 1
- Update Livewire
- role permission wiki HOT 1
- [Frontend] Change the contents of the chosen language to change all saved contents
- [Feature] Categories and (unlimited loops of) Subcategories
- [Bug] Remove adding double db_prefix from InsertDemoData.php HOT 1
- Request to add dropdown menu sample in navbar HOT 1
- Frontend page language dropdown menu bug HOT 3
- Fonts not loading HOT 1
- Error on module build HOT 1
- Error in create new role and user reporter
- Register option not showing HOT 2
- Demo site is broken HOT 1
- Upgrade to Laravel 11 HOT 2
- Frontend and Backend Issues - Are Updates No Longer Being Applied? HOT 1
- Email verify "Aunauthorized action"
- Most issues stem from the same root cause. HOT 1
- There is a problem when uploading images,the LFMButton woking error HOT 3
- dark mode HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-starter.