Laravel voyager migration issue - php

I am working on windows and WAMP. I installed Laravel 5.4 within cmd and that was successful. After that I follow laravel voyager installation process and that was successful too.
Afterwards I checked /migrations/ folder and there are many tables for migration, for laravel itself and for voyager, but when I type php artisan migrate in cmd it migrate only "users" table, it ignored other tables so voyager is not working and showing errors that tables are missing.
I searched internet but could not find this type of issue.
I'm using mysql

In the Voyager documentation it says the following:
Before installing Voyager make sure you have installed one of the following versions of Laravel:
Laravel 6
Laravel 7
Laravel 8
Additionally Voyager requires you to use PHP 7.3 or newer.
Apparently with Laravel 5.4 it will not work .
To use Voyager on Laravel 5.x, you need to use version 1.3 of Laravel Voyager: https://github.com/the-control-group/voyager/tree/1.3
Remembering that it is not necessary to use the migrate command for Voyager to work.
The steps are:
composer require tcg/voyager
Next step you must create your database and insert your credentials in the .env file
You can choose to install Voyager without dummy data or with dummy data. For an installation without a dummy data, run the command:
php artisan voyager:install
For a dummy data installation:
php artisan voyager:install --with-dummy
You will need to access the url http://localhost:8000/ admin to access the voyager, if you installed with dummy data, you will have a super user created, with the following credentials:
email: admin#admin.com
password: password
If you have not created any dummy users, you can set an existing user in your database as admin by running the command:
php artisan voyager:admin your#email.com
Or you can create a new admin user, using the command:
php artisan voyager:admin your#email.com --create

Related

Artisan publish Sanctum without a migration file

Sanctum Version: 2.15
Laravel Version: 9.11
PHP Version: 8.0.2
Database Driver & Version: mysql
Description:
I publish Sanctum did not generate the configuration
Steps To Reproduce:
The Laravel Sail development environment was used
into the shell and perform
php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"
prompt
Copied Directory [/vendor/laravel/sanctum/database/migrations] To [/database/migrations] Publishing complete.
But there are no migration files generated under my migrations directory
Later, I checked the directory permission and found no problem.
Although it can be added manually, I still want to know where this problem can be investigated, because I did not see it mentioned in the document

Cannot create a user in Voyager (laravel 6.x)

I've installed the admin package Voyager (without dummy data) on my Laravel project and when I want to create a user to access the admin panel with the following command: php artisan voyager:admin admin#admin.com --create, I get the following error:
After a little bit of searching, I found this link: https://github.com/the-control-group/voyager/issues/5082 => saying that this command does not work with PHP 7.4 and to make it work, I should either upgrade to PHP 7.4.1 or downgrade to PHP 7.3.
I'm using Wamp Server and decided to downgrade to PHP 7.3.12 since this version exists by default in C:\wamp64\bin\php
I have also edited composer.lock and composer.json in my project and then ran the command composer dump-autoload. But it still doesn't work. Am I missing something?
Had the same issue, upgraded to php 7.4.27 and it worked.

Laravel 8.X - How to generate auth files/scaffolding in the absence of make:auth command

I am trying to port a legacy/joomla code into larvel framework. I am trying to reuse old database tables with laravel 8.16. I have added the following columns in the existing users table
created_at,
updated_at,
remember_token
Now, when i try to run 'php artisan make:auth'. The command is not available. What should I do or which command should I use to create scaffolding?
Laravel UI installation
At first, install laravel ui by running below command
composer require laravel/ui
Add UI scaffolding
You can add ui view by running:
php artisan ui:auth
And add authentication controllers by running
php artisan ui:controllers

laravel passport not working in laravel 5.8

I am trying to install laravel passport in my laravel 5.8 website to implement oauth2 and access token for API requests. I ran this command composer require laravel/passport but i getting error and i knew Latest version of Laravel Passport dropped support for Laravel 5.8, so i tried installing earlier passport version with this command composer require laravel/passport:7.5.1 , now i installed but then when i run next command php artisan migrate i get following error -
Migrating: 2016_06_01_000001_create_oauth_auth_codes_table
Illuminate\Database\QueryException : SQLSTATE[HY000]: General
error: 1364 Field 'id' doesn't have a default value (SQL: insert into
migrations (migration, batch) values
(2016_06_01_000001_create_oauth_auth_codes_table, 2))
I checked database and saw only one table created oauth_auth_codes, After the error i did not proceed further with the command php artisan passport:install.
So what steps i take to install laravel passport in my laravel 5.8 website with all required tables??. So that i implement oauth2 server and tokens when request comes to my laravel site API endpoints. Plase answer with details, It's a tough project i am having right now.
With Laravel 5.8 version, installing passport as per laravel documentation https://laravel.com/docs/5.8/passport#introduction will not be completed. Things that you need to have for successful running of passport on laravel 5.8 , please follow the following steps:
Install Passport (you had did it already) using:
composer require laravel/passport:7.5.1.
Now Before migration : put below code into composer.json as:
"paragonie/random_compat": "2.*" .
You can see in below picture as well.
Now, You need to write in terminal as :
composer update (now you are good to go).
now, php artisan migrate.
php artisan passport:install
Thank you. I am sure it will work for you. :)

artisan error while installing admin panel via composer

I am using laravel 4.2 and want to install admin panel. I tried to install it from here.
It installed complete after that i followed step 2 and 3 from that link.
And when i followed step 4 and tried this command
php artisan admin:install
I got error
there are no command defined in the 'admin' name space
Also i tried many other admin panel in laravel 4.2, but when i try to install it i am getting same error all time, only namespace will change.
I tried php artisan list and i can't find that command in list.
Run
php artisan optimize
to remove cached files and generate them again

Categories