How to reinstall user auth modules in laravel - php

I inherited a Laravel project in which there doesn't appear to be a app/User.php file or any migration scripts related to the creation of user tables for the database. This project was initially used to create a simple REST API end point to write records to a single table without authentication.
Is there a simple command I can run to re-introduce the Laravel user components? My goal is to install Laravel Passport with OAuth2 support, but it seems to depend on the existence of user modules.

you can follow the instruction in the docs: https://laravel.com/docs/7.x/authentication#introduction
Want to get started fast? Install the laravel/ui Composer package and
run php artisan ui vue --auth in a fresh Laravel application. After
migrating your database, navigate your browser to
http://your-app.test/register or any other URL that is assigned to
your application. These commands will take care of scaffolding your
entire authentication system!

Related

Laravel breeze package overwrite existing files

I am working on a laravel project, for authentication, I have used passport for API. and used php artisan ui bootstrap --auth for web PHP. using php artisan ui bootstrap --auth laravel not be able to authenticate the current user I have researched a lot and found a solution which is a package name breeze that offered by Laravel 8.
when I install breeze it adds many templates and overwrites a few functions and blades. can anyone know how to not overwrite existing function or adding templates while installing?.
Question is : how to install breeze package without breeze scaffolding?
There is no way to install breeze without breeze scaffolding
Its possible to use passport with laravel ui, i dont understand, which problem have you before install breeze.?
You can just follow passport documentation https://laravel.com/docs/8.x/passport

How to create a composer package for a Nova Resource

I am building a Nova Page Builder for our company but am new to creating composer packages. Here is what I have as far as files:
Models / Page.php (model)
Nova / Pages.php (handles fields for the model)
Migration file to build "pages" table
Requires other composer packages for things like nova-tabs, nova-menu, nova-flexible-fields.
I have this all working in a Nova project but we are wanting to turn this into a composer package that can be installed in other projects. I can think of 3 ways to do this.
Create a custom Nova tool (I don't want to have to do all of this unless necessary, creating custom Vue components for default Nova behavior seems like overkill)
Publish the above files to the app/database directories using Composer and run the migrations
Somehow link the vendor/ files for this package to the local app instance? I'm not even sure if this doable.
It would be nice if we could just include a service provider and it would all work, is that possible without creating a custom Nova tool?
Any advice on which route to go down?

Can't Login after Logout in Laravel 6

I have a Laravel project whose version is 6.4. Trying to build a simple authentication process. So went through the latest documentation as Laravel now considers authentication as a different package. What I face as a problem is that whenever I register it takes me to the home page which is obvious. But after logging out I can't log in to the system even if my credentials are correct. Any solution for that? Below is a list of commands I fired to do authentication scaffolding.
composer require laravel/ui
php artisan ui vue --auth
npm install && npm run dev // for views
My default auth guard is web which uses session driver.
I tried uncommenting the \Illuminate\Session\Middleware\AuthenticateSession::class in the kernel, but still can't log in.
Check the username field in the login form and database, this name should be the same as the value of the username() function in the file
Illuminate\Foundation\Auth\AuthenticatesUsers.php

deploy web application with laravels voyager admin panel

i developed a Website using Laravel 5.5 and Voyager Admin panel.
Now i want to deploy my website to a DigitalOcean server.
While developing I created tables via Voyagers Database Tool.
I also set my relations between the tables there. This worked very well in my developing environment.
I pushed my final code of the website to a git repo and now i want to clone it on the liveserver.
Now my question:
Do I have do recreate all tables again via the voyager admin panel and set the relations between the tables new again? Because i didn't create migrations for the tables and only created tables through the voyager backend.Or will they automatically be set if i clone the repo and make an php artisan voyager:install or an php artisan migrate?
Would be nice if anybody already gained some experience with deploying voyager applications.
Best regards
If you still didn't find any solution, you can try: Laravel Migrations Generator.
It will automatically generate migrations from an existing database schema.
Then you can do:
php artisan migrate
Hope, it will solve your problem.

How to create a build update in laravel?

I want to know there is any way by which we can create a installer or some package for laravel application by which user can simple paste file and deployer will ask for db host and other setting and install application.
Also is there anyway by which we deploy a new build in current application and it will have all new updates which may contains updates in previous table. We want to keep data safe and release updates.
Got help from this answer
Install
To create installer for your application, you can Laravel-Installer package.
This package has following features:
Check For Server Requirements.
Check For Folders Permissions.
Ability to set database information.
.env text editor
.env form wizard
Migrate The Database.
Seed The Tables.
Update
Updating your database mean needs to migrate your database. You can run your migrate command through your application.
Run migration command from anywhere
Artisan::call('migrate');
With using route:
Route::get('/run-migrations', function () {
return Artisan::call('migrate', ["--force"=> true ]);
});

Categories