I am following Laravel documentation for creating Authentication system.
My Steps Are
Installing fresh laravel using laravel new my-project
Then enter into directory (cd my-project). Edit the database config file with database credentials.
Then run php artisan make:auth. All migration php files are created.
Run php artisan migrate. CLI responds with nothing to migrate
So I went back to check the database using phpmyadmin. I do not see any migration table.
System & Version info
Vagrant box laravel/homestead
Database mariaDb
Laravel installer v1.3.5, by cli command laravel -v
Laravel v5.4.16, from composer.lock
Can anyone point me to the right direction?
Also, you can try this:
php artisan migrate:install which creates the migrations table only
php artisan migrate runs your other migrations
Configure your database in .env file
DB_HOST=127.0.0.1
DB_DATABASE=DbName //Your DB Name
DB_USERNAME=root
DB_PASSWORD=password123
Related
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
Hello im begginer at laravel I was given a repo with database, and then when i want run new migration -php artisan migrate it gives an exception like this picture, anyone know how to solve this? thx before
laravel\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDO\Exception.php:18
Doctrine\DBAL\Driver\PDO\Exception::("SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation "personal_access_tokens" already exists")
laravel\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOStatement.php:119
Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException))
enter image description here
Try to follow those steps:
1.Run git clone <project-name-from-github>
2.Run composer install
3.Run cp .env.example .env
4.Run php artisan key:generate
5.Run php artisan migrate or php artisan migrate:fresh --force
6.Run php artisan serve
I renamed my example.env to .env in order to remove previous errors with my application. However, I noticed
APP_KEY=SomeRandomString
near the top of the .env file an new something was off. When I run
PHP artisan key:generate and recheck the .env file...nothing happens.
My stack includes Apache2, Ubuntu Server 14.04 LTS (HVM), PHP 5.5.36
Looks like Laravel still uses the older .env file even it has been deleted, try to optimize the class loader using php artisan optimize then regenerate your key.
I'm developing a package (under workbench) which depends on another package (https://github.com/efficiently/authority-controller) for user role management. For this package to work, I need to run a migration initially. But however when I run the command php artisan migrate --package=machuga/authority-l4, it says Nothing to migrate.
I tried running php artisan dump-autoload from the root, and also php artisan migrate --bench=machuga/authority-l4 but nothing seems to work.
Try add Authority\AuthorityL4\AuthorityL4ServiceProvider to your providers and run:
php artisan migrate --package=machuga/authority-l4
I think, efficiently/authority-controller depends on machuga/authority, but doesn't call the provider.
when try to migrate Laravel 4 with table 'user' in database using artisan:
php artisan migrate:make --table="user" CreateUserTable
I receive this error:
C:\xampp\htdocs\laravel>php artisan migrate:make --table=user CreateUserTable
[21.04.2014 02:27:56 NOTICE] Successfully established connection to the database
[21.04.2014 02:27:56 NOTICE] Event Reporting is not allowed at the
moment. Reaso ns: Pre Startup or Post Shutdown
{"error":{"type":"Symfony\Component\HttpKernel\Exception\NotFoundHttpExcepti
on","message":"","file":"C:\xampp\htdocs\laravel\vendor\laravel\framework\
\src\Illuminate\Foundation\Application.php","line":871}}
C:\xampp\htdocs\laravel>
how to solve this?
thanks,
I solved this by install all laravel dependences using composer (not download it from GithHub)
to install all dependencies with composer.
change directory to laravel folder in cmd and than type
composer update
and hit enter and wait until it is done.