Modify a Vendor Migration in Laravel - laravel

I'm attempting to use UUID's for my user ID's in Laravel and to support this I need to modify a vendor migration (in this case the Voyager admin panel) to change the user id type.
Is there a way to do this?

You can create this type of migration file: https://github.com/laravel/fortify/blob/1.x/database/migrations/2014_10_12_200000_add_two_factor_columns_to_users_table.php

Related

Laravel 9 Sanctum: how to modify the built-in migration for table personal_access_tokens

I'd like to use UUID's for my user table and therefore have to modify the personal_access_tokens table to be able to handle it (uuidMorphs() insteand of morphs()).
Problem is, the migration for this table is delivered with Sanctum inside the vendor folder (2019_12_14_000001_create_personal_access_tokens_table.php). Is there a way to modify/overwrite it?
I found the solution in the Laravel Sanctum docs:
https://laravel.com/docs/9.x/sanctum#migration-customization

Change model And database table name in Laravel

I want to change my model name and its database table name in a Laravel project, but I've connected other models with relationships. So now I want to know if there is any way or artisan command to change it, so it does not make problems for its connection?

Is there some way to use already created database table in voyager?

I am using voyager to create admin panel for my app. Link for voyager is https://github.com/the-control-group/voyager. I need to use already created database tables which I created in phpmyadmin but can not find way to do so. Voyager gives some already built tables like categories, menus, pages etc. and also let us create new tables but how can I use my own created tables which I created in phpmyadmin?
Its possible use your owns tables, inside bread section should appear the option to make bread of it.
To make a bread of a table you should create the model of that table, if you have the table "articles" you can create the model with "php artisan make:model article"

laravel-voyager custom views for role

Laravel Version: 5.26.27
Voyager Version: 1.1.3
PHP Version: 7.2.1
Database Driver & Version: MySQL 5.6.38
Description:
I'm new to Voyager but have already managed to create tables, populate them and configure their access privileges for BREAD.
But I need one option to see in the posts the custom roles can view just himself post, I see one option
#foreach($dataTypeContent->where('author_id','=', Auth::user()->id) as $data)
But this code modifies all views because is in the view. I need some more generic in the model
Is this possible with Voyager or it calls for custom code?
Thanks in advance!
Your question is a little confusing to read, but it sounds like you're asking if it's possible to override Voyager views or add custom views and the answer is, yes you can.
They have a video here: https://laravelvoyager.com/academy/views/
and written documentation here: https://voyager.readme.io/docs/overriding-views
The short of it is, create a directory resources/views/vendor/voyager/slug-name where slug-name is the slug for the corresponding table view you want to override. Put an edit-add.blade.php file in that folder along with a browse.blade.php file. I would just copy Voyagers default view logic into those files and then modify them to suit your needs.

How to show specific table structure in a Laravel controller?

I forgot my cPanel credentials so that now i need to confirm about some table fields i.e data types etc so that I want to connect with that cPanel i am using Laravel 4.2 and have no env file. Can anybody can give me a solution for this problem.

Resources