Remove frontend scaffolding from Laravel 8.x - php

I have installed laravel/ui from composer and since I am learning I tried to setup bootstrap with it so I installed bootstrap from npm and then ran php artisan ui bootstrap. I was able to set it up properly.
I now want to remove the installed frontend scaffolding and I couldn't find anywhere how to do it.
So far I have tried php artisan ui none but none is not a valid preset.

You can remove the package by running:
composer remove laravel/ui
You'll have to remove the scaffolding manually.

Related

App.css and App.js still not found in laravel 9 after npm run dev

Quite new to Laravel and I made sure I did looked into the documentations of Laravel 9 before diving but incase I missed one, I have this issue wher app.css and app.js on the the link served by artisan are not found. Boostrap scaffolds are now in the views folder but it seems like the (quite unsure about this) the app.js & app.css are still inaccessible so bootstrap doesnt work. I made sure to run npm install and npm run dev after the bootstrap and boostrap --auth installation from artisan. As of now the project is totally fresh so it works except the boostrap won't load because of the 404 error. Here are some snapshots of the projects including the running terminal sessions.
Commands used in sequence:
composer require laravel/ui --dev
php artisan ui bootstrap
php artisan ui boostrap --auth
npm install
npm run dev
All of the threads I've looked here in SO are stating they're not running npm dev which I am running already but I still haven't manage to find a working solution.
You can follow below steps:
create project with laravel
composer create-project laravel/laravel "project name"
install laravel UI for bootstrap 5
composer require laravel/ui
Generate login / registration scaffolding with bootstrap 5
php artisan ui bootstrap --auth
import bootstrap 5 path in vite.config.js
import path from 'path';
resolve:{
alias:{
'~bootstrap': path.resolve(__dirname, 'node_modules/bootstrap'),
}
}
import bootstrap 5 scss in js folder
import '../sass/app.scss';
import * as bootstrap from 'bootstrap';
use #vite blade directive in your template
#vite(['resources/js/app.js'])
finally build your asset file.
npm run build
and then run project using artisan command.
php artisan serve

Laravel 8 - Bootstap ui does not install

In my Laravel 8 application, after installing laravel ui, when I try to run 'php artisan ui bootstrap' I get the following error:
In Bootstrap.php line 70:
copy(C:\xampp\htdocs\netlytics\resources\js/bootstrap.js): Failed to open stream: No such file or directory
I have run composer update successfully.
I have laravel/ui version 3.2.0. I am running Laravel 8.40.0 with PHP 8.0.3.
The site is an old site that I upgraded from Laravel 5.3 and PHP 5.6.
The pre-processing was being done using gulp with a gulpfile.js to configure the mix conversions.
With Laravel 8 I know I need to update my pre-processing to use webpack.mix.js, but so far can't get there.
There is supposed to be a resources/app/bootstrap.js file but it is not showing up and I do not know what it should look like if I wanted to put it there.
Any ideas how to get this installed correctly?
I poked around and finally discovered that I needed to install jQuery and jQuery-ui as well as popper.js. I installed those and again got the same error, but this time I just created a resources/app/bootstrap.js file and when I ran 'php artisan ui bootstrap' it ran and populated the bootstrap.js file.
Here solution:
https://stackoverflow.com/a/68393896/15391779
composer create-project laravel/laravel --prefer-dist laravel-bootstrap
composer require laravel/ui
php artisan ui bootstrap --auth
npm install
npm run dev

How to install vue js in laravel 8 without jetstream and Inertia?

I'm working on a project with Laravel 8 version and I want to work with vue js components without installing jetstream and inertia. Is it needed to install Jetstream with inertai in order to work with vue js in laravel 8?
You don't need any additional Laravel components to use Vue. You only need npm or yarn to install packages and create a composer.json file. Follow the instructions at https://v2.vuejs.org/v2/guide/ (for Vue2) or https://v3.vuejs.org/guide/introduction.html for (Vue3) for installation.
For Laravel/Vue, Vue will be used as a front-end, which will use ajax/Axios to use GET/POST requests to Laravel for the backend.
At first, you need to install laravel/ui package by running composer require laravel/ui:^2.4 as Said in laravel doc version 7
After that, you should run php artisan ui vue for adding vue scaffolding to the project.
after create laravel project,you need to install laravel/ui and don't specify the version
composer require laravel/ui
then run php artisan ui vue --auth for Generate login / registration
scaffolding...
php artisan ui vue without login/registration

Laravel 6 user auth page not working properly

Today I installed laravel 6.x version for a new project.
I have PHP 7.3 in my system so laravel 6 was successfully installed.
Then I run this command to set the Auth UI for VueJS.
artisan ui vue —auth
along with this command:
composer require laravel/ui --dev
But when I checked my login page, it was just an html skeleton.
I checked over the internet and found a solution and tried to run this command,
npm run dev
But still am getting an ugly login page without css and Js files. I checked for CSS and JS files but found no solution.
Anyone please help and tell me how can I setup the front end scaffolding.
Thanks in advance
The command to implement Auth is as follows:
composer require laravel/ui
php artisan ui vue --auth
If your Login and Register page only shows plain HTML. And CSS is not loading properly then run this two command:
npm install
npm run dev
OR
Simply you've to follow this two-step.
composer require laravel/ui
php artisan ui:auth
This will solve your problem for sure!
Check if your npm install shows any deprecation error,
if shows then go to nodejs official site https://nodejs.org/en/ and download and install latest one in your system.
Then in your terminal run:
npm install
npm run dev
That's it.
In your laravel public folder, css and js should have shown after that npm run dev command.
Now your login and register page should be nice looking as expected.
Do one thing,
1) Create app.css and put into project_name/public/css/
2) Create app.js and put into project_name/public/js/
I believe it will work.
If not, make sure you have used these commands before.
npm install
npm run dev
Thanks.

Auth resources are missing in laravel

I want to make use of auth system which comes with the laravel package but the problem is when I make new laravel package using composer i.e composer create-project laravel/laravel project name --prefer-dist
it do not install those auth resources which includes (i.e. auth folder inside resources > views) and also I can't find the Services Folder inside app directory.
All other things are working fine except this authentication system.
What can be the possible problems? Please give me solution
I am working with MAMP.
Taylor Otwell has made it opt-in for Laravel 5.1
You need to run following command after installation
php artisan scaffold:auth
UPDATE
I think this has been answered here
You could also run the command php artisan make:auth in the root directory of you laravel project. I had the same problem and it worked for me.
The command php artisan scaffold:auth didn't work for me i don't know why.
it issued the error:
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "auth" is not defined.
Did you mean this?
make:auth
in Laravel 5.2 you just have to run this command "php artisan make:auth" and the auth folder will be created
Since laravel 6.* version make:auth is no longer supported, use ui:auth instead.
For deploying ui pack run
composer require laravel/ui --dev
then update composer.json :
composer update -W
and do the:
php artisan ui:auth
You need execute
php artisan make:auth
now if your style css and js are missing
You need load file .css and .js
1) execute in your project
npm install
2) then execute
npm run dev => now in folder /public now exist folder js and css
3) reload page

Categories