@snapey sorry i forgot the migration syntax in tension.
i tried
php artisan make:migration add-hotel-to-tables --table=products
and changed to
$table->integer('hotel_id')->unsigned()->after('id')->nullable();
$table->foreign('hotel_id')->references('id')->on('hotel_registrations');
php artisan migrate worked correctly
but in the same migration file if i just change the table name and do php artisan migrate then it says nothing to migrate.
so i followed sql commands
//this is for users table
ALTER TABLE `users`
ADD COLUMN `hotel_id` INT(10) unsigned AFTER `user_name`;
ALTER TABLE `users`
ADD KEY `users_hotel_id_foreign` (`hotel_id`);
ALTER TABLE `users`
ADD CONSTRAINT `users_hotel_id_foreign` FOREIGN KEY (`hotel_id`) REFERENCES `hotel_registrations` (`id`);
just i made duplication of this code and changed the table name and foreign key name thats it.
for all tables the column with primary key is added.
but really u gave much more explanation thank you thank youuu soooo much..
and for If you have 26 tables though, with data you cannot lose, I have not a clue how you will populate these tables with the hotel_id value?
for this answer is
i will do
where ('hotel_id',Auth::user()->hotel_id)
so based on this the records are fetched.
Kindly refer this link: https://laracasts.com/discuss/channels/laravel/guys-need-a-big-suggestion-for-login-permission-for-different-users-laravel
for my changes plz