I’m Trying to Preview images from database as im saving album in table albums and album images in table images and connecting with relation but i can’t preview the images from table image so i’m adding relations between the 2 tables and trying to preview the images but its not working with me something went wrong but i cannot figure
Tag: migration
Can you delete models referenced in migrations with foreignIdFor()?
I have an old migration where I used the foreignIdFor() method to create a column. I later decided to delete the model which was referenced and now, when I do a migrate:refresh locally, that migration triggers an error saying that the model doesn’t exist, of course. So, should one never delete models referenced with foreignIdFor() and use unsignedBigInteger()instead ? EDIT:
SQLSTATE[42000]: Syntax error or access violation: 1064 Is given when attempting to migrate
I am attempting to migrate 3 models using: But I am given the error mentioned in the title This is the rest of the error message: This is my code: I am new to coding in general and would very much appreciate some feedback, thanks in advance. Answer The main thing that jumps out to me in your migrations is
Can’t do PHP Artisan Migrate with SQLSTATE [42000]
I just want to PHP Artisan Migrate, I’ve just completed my table on migration but have error I’ve checked my completion that there is no error or any miss spelling I’ve not added nullable because all column have to fill I’m using Laravel 8.6 and on Windows with XAMPP and MariaDB Answer The foreignId method creates an UNSIGNED BIGINT equivalent
Should I add ‘ before integers when making an ENUM field
I want to create a Migration and this Migration has a field named is_active which takes one of 1 or 0 values. So I tried: But I wonder, if this alright or I should write it this way: So which one is true ? Answer You can read in the PHP Docs that string ‘0’,int 0,float 0.0 are considered as
How to store some tags in Laravel and how can I technically store those tags using the same ID
My question is that is okay to do it ID or some integer in migrations and how to store multiple tags using the same ID in controllers? Storing like this (storing multiple tags on the same ID): ID TAG 1 LARAVEL 1 PHP Answer I’m not sure the reason why you want to save the tags with same id in
laravel 8 migration error: Unknown column ‘batch’ in ‘order clause’ (SQL: select `migration` from `migrations` order by `batch` asc, `migration` asc)
[SOLVED] i new to Laravel and PHP. i tried to migrate my own migrations but i can’t. this my laravel and php information: my php info PHP 8.0.3 (cli) (built: Mar 4 2021 05:33:14) ( NTS ) Composer version 2.0.11 2021-02-24 Laravel 8.x mysql Server version: 10.5.9-MariaDB Arch Linux my OS info uname: Linux ali 5.4.105-1-MANJARO #1 SMP PREEMPT 2021
How to add constraints to existing keys using laravel migration
I currently have a database in my project which has already been put in production. But I didn’t use constraints in the previous migrations. Now I have tables products, shops and an intermediate table product_shop. The problem is that if I delete any product, that has been put on some shop, the pivot is still kept in the intermediate table.
Laravel Migration: “ERROR Class not found”
I’m new to Laravel, I’m building a small project with five tables: users, products, category, transactions, and a pivot table category_product. When I try to run the command Php artisan migrate I receive an error class “Transaction” not found here are the tables. User Table Reset Password Table Products Table Categories Table Transactions Table Category_product Table ** The order of
Laravel 7 migration error. Cannot add foreign key constraint
Try to create foreign key in Laravel 7 but when I migrate tables using artisan it gives error SQLSTATE[HY000]: General error: 3780 Referencing column ‘remote_id’ and referenced column ‘parent_id’ in …