Laravel 9 - Jetstream with Bootstrap (Jetstrap). Missing app.css and shows ugly view - laravel

I'm following this video tutorial (in spanish), which shows how to implement Jetstream with Bootstrap instead of Tailwinds: https://www.youtube.com/watch?v=Wt-OuBX6lEc&list=PLZ2ovOgdI-kWWS9aq8mfUDkJRfYib-SvF&index=31
The issue is this one: despite I've followed the steps strictly, I'm getting two important errors.
First of all, I should have a file named "app.css" into my folder "/public/css", but I don't. I don't have even a folder named 'css' into the 'public' directory, neither another lots of folders I should.
On the other hand, both my welcome view and my register view look ugly, like this:
The commands I've done are these ones:
Into:
leandro#leandro-Lenovo-B50-10:/var/www/html$
laravel new bootstrap --jet
cd bootstrap
Then,into:
leandro#leandro-Lenovo-B50-10:/var/www/html/bootstrap$
composer require nascent-africa/jetstrap --dev
php artisan jetstrap:swap livewire
npm install
npm run dev
php artisan migrate
sudo chmod -R 777 .
Also, the register view shows an error, unless I have activated VITE (with npm run dev).
Somewhere, I had to do a 'php artisan migrate:fresh', because a migration error.
I'm running the project into an Apache server.
I'm using:
Linux Mint 21 Vanessa
Apache/2.4.52 (Ubuntu)
PHP 8.2.1
Laravel v9.50.2
Does anyone have an idea of what's going wrong? It might be a conflict version, since I'm using Laravel 9, while the video is explained for Laravel 8.
I don't know if there's any additional information needed.
Thanks a lot!

Related

Is there a way to fix missing files of laravel 5.6

Some guy made a site with laravel 5.6 and we at a different place need to change just some tags and the CSS, I have a git of the site but "vendor, .env" and many files that are also missing in the git, how can I open the site in my computer to adjust the style sheets I have no database backup and also installed laravel 5.6 and try to paste de missing files but there are still many errors.
Altough the original programmers excluded some files in the git repo using the ignoregit file I created a new laravel 5.6 project and copied the missing files to my original app folder, imported the missing packages using composer and finally used artisan to migrate the database using "php artisan migrate"

Simplest way to get Laravel "Hello World" going?

I have programmed in PHP for many years, but it was before frameworks like Laravel. I am trying to understand Laravel now.
Can someone point me to something that explains the simplest possible way to get a Laravel "Hello World" app running. I know how to use composer. I have a Linux shared hosting account I can use for this.
I'd appreciate if someone could explain how I can get a simple Laravel example up and running, without having to install a ton of stuff on my PC.
Thanks.
Using composer download the latest version of laravel. Documentation is available at https://laravel.com/docs/5.8
composer create-project --prefer-dist laravel/laravel hello
After that go to that directory
cd hello
and run this command
php artisan server
Now open the browser and go to http://127.0.0.1:8000/
You will get a basic page that says Laravel and some links
Open hello with your code editor and open this file resources/views/welcome.blade.php
Write some content on the page and check http://127.0.0.1:8000/
You can watch the https://laracasts.com/series/laravel-from-scratch-2018 to get a basic idea.
(Optional) If you are in windows you can use https://laragon.org/ in that the installation is pretty easy.
To run this app on shared hosting.
First,
1) Create a folder Application on your file manager
2) Upload files to that folder. (Laravel files, installed via composer)
3) Move public folder files to /public_html/ if you want the site in root domain
4) open index.php file and edit these lines
require __DIR__.'/Application/vendor/autoload.php';
....
$app = require_once __DIR__.'/Application/bootstrap/app.php';

Laravel Nova: Build Components

First post.
I'm currently building a Laravel Nova application. I'm making changes to the dashboard component - more specifically the file within the "resources/js/views/Dashboard.vue".
I'm struggling to build the component - does anyone know how to build the component? I have some code which runs webpack.mix to build my JS and SCSS files, but I'm pretty sure it doesn't include the files within the Laravel Nova instance.
Any help will be great.
EXTRA:
I've already tried run the webpack command to build from inside the Laravel Nova instance but it errors out.
UPDATE
I found renaming my webpack.mix.js.dist to webpack.mix.js, running npm run dev whilst within the ./nova directory worked... but only after running php artisan nova:publish
I've wrote a command to compile all these steps but do I have to run php artisan nova:publish everytime, just seems...tedious?
By default, Nova's JavaScript is compiled for production. As such, you will not be able to access the Vue DevTools out of the box without compiling Nova's JavaScript for development. To accomplish this, you may use the following terminal commands from the root of your Nova project:
cd ./vendor/laravel/nova
mv webpack.mix.js.dist webpack.mix.js
npm install
npm run dev
rm -rf node_modules
cd -
php artisan nova:publish
Details: https://nova.laravel.com/docs/2.0/customization/frontend.html#vue-devtools

Laravel deleting package with composer

I tried to delete barryvdh/laravel-debugbar from my laravel installation, and it seems I didn't make something right.
What I did so far :
composer remove barryvdh/laravel-debugbar
I deleted then the references in config/app.php
And I've got an error :
[RuntimeException]
Error Output: PHP Fatal error:
Class 'Barryvdh\Debugbar\ServiceProvider' not found in
{mypath}\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php on line 146
I tried dump-autoload, clear-compiled, but none works.
What did I miss ?
22/02/2016 Edit : I also tried to remove ALL the vendor folder, then install it again via composer install, but I got the error again when the command php artisan clear-compiled was run angain.
Ok, it seems I had played with artisan commands, and the configuration file was cached (via php artisan config:cache).
I deleted it (in bootstrap/cache/config.php) and everything works like a charm, but I also could have used the command php artisan config:clear to remove it.
When you installed Debugbar, after the package was install via composer you needed to add the class to the providers array in config/app.php. So you need to remove this line from there:
Barryvdh\Debugbar\ServiceProvider::class
If you also register the facade, then you need to remove the following from the aliases array from the same file:
'Debugbar' => Barryvdh\Debugbar\Facade::class
If you also ran php artisan vendor:publish (which is the final step described in the Installation Section from the package readme) then you can delete the config/debugbar.php file as well, although leaving that configuration file in place will not cause any issues.
Marc Brillault's answer is correct. I am adding more clarification to that answer:
I removed debug bar class manually from the catch files. present in (bootstrap/cache/config.php).
Steps for How to remove manually class.
1.) Open this two files
`bootstrap/cache/config.php`
`config/app.php`
2.) Find this two line and remove It.
Barryvdh\Debugbar\ServiceProvider::class,
'Debugbar' => Barryvdh\Debugbar\Facade::class,
3.) run command `php artisan config:clear`
after the following this step check command php artisan list is working well.
you must:
First. Delete the references to Debugbar in config/app.php
Second. composer remove barryvdh/laravel-debugbar
In that order. If you don't, Laravel get confused ;)
The best ways you need to do is delete all file manually in all composer files.

Laravel 4: php artisan down not defined

I've updated my Laravel installation with the following commands today (which is a few days after Laravel 4's release date):
php composer self-update
php composer update
You can have a look at my composer.json file here: http://paste.laravel.com/umX
In the Docs I've found out about the Maintenance Mode... (http://laravel.com/docs/configuration#maintenance-mode) Trying to use it returns:
[InvalidArgumentException]
Command "down" is not defined.
Command I've entered in the terminal for this exception:
php artisan down
My current version:
php artisan --version
Laravel Framework version 4.0.0
Any ideas? Did i miss something, am I still on some old version possibly?
Thanks in advance and best regards, Martin.
The fix for me was to update the 'providers' array in ./app/config/app.php. I thought I was doing a pretty good job of manually updating the L4 skeleton near the end of the beta period, but there was a minor change in that array (not sure which line) that allowed the 'down' command to finally appear in artisan.
The first thing I suggest you do is just run php artisan list to get a list of all the available commands. If the up and down commands aren't listed then you probably aren't fully updated.
If you have a bootstrap/compiled.php file try deleting it. Also make sure you pull the latest changes in from the laravel/laravel GitHub repository to update your application skeleton.
Once you've done the above you can again check for the existence of the commands by running php artisan list.
In app/start/global.php (or app/start/artisan.php), you need:
App::down(function() { return Response::make("Be right back!", 503); });
don't you?
Perhaps you could also try updating laravel via composer "composer update" in CLI.
I've just installed a clean Laravel 4 clone and tryed the maintenance mode with it.
Everything's working as supposed...
I've also compared the composer.json files + I'm pretty sure I've done nothing wrong updating to the stable release version even thought my app/start/* php-files remain unchanged.
Summary:
Composer seems to not override the php files in app/start/* which would be needed in order to get the maintenance mode working correctly. Probably there are even more files not being updated. This also makes a lot of sense, since you could have done some important customizations to your application there.
Correct me if I'm wrong... I'll start importing my package into a clean install thought. Don't want to run into more trouble due to this.
Best Regards, Martin.

Resources