Laravel and HTML Form Builder - laravel

I like the Form Builder. Go Laravel.
What's the difference between the Illuminate version and the Laravel Collective version, and which should we use? Is the Illuminate version now defunct?

You have an explanation here : http://laravel.com/docs/5.0/upgrade#upgrade-5.0
under Form & HTML Helpers
Basically, the Illuminate versions of the Form helper and HTML helper are deprecated in the current version of Laravel and have been removed from the framework's core. They are now maintained by the Laravel Collective.
So if you working with Laravel 5, you should use the Laravel Collective version, you can find it here: laravel Collective: Forms & HTML

In Laravel 5 it is not standard anymore, but you can add it quickly in the composer file if you prefer to work with forms like you did in Laravel 4.
Just add this line in the composer.json, under the require section:
"illuminate/html": "5.*"
After this step you first need to run the composer update command and you should be good to add the rest.
Then you need to add the service providers in config/app.php under providers section like this:
Illuminate\Html\HtmlServiceProvider
And as the last part enter these two lines in the config/app.php under aliases section:
'Form'=> 'Illuminate\Html\FormFacade',
'HTML'=> 'Illuminate\Html\HtmlFacade'

Related

How can I use authentication without Bootstrap?

In Laravel, I know running composer require laravel/ui and then php artisan ui vue --auth creates authentication scaffolding but it uses Bootstrap. Is there a way to create this scaffolding without Bootstrap?
Unfortunately and as I know, there is no alternative for the bootstrap UI in laravel authentication scaffolding, as I know there is a tailwind but the last update on the repo was 2 years ago so not sure if it is supported now
https://github.com/laravel-frontend-presets/tailwindcss
also, you can change it or create a new one, all view files in this path
resources/views/auth
if you want use TailWindCss And Compatibility with Laravel V9
You Can Use this package :
Github Repo
It's very simple and I've been using it for a few minutes

Laravel 8.x Tailwind Prefix

Tailwind allows prefix to be set in tailwind.config.js.
Reference here.
I'm working on a Laravel project that uses Bootstrap and Tailwind simultaneously, managed by npm. I've set a prefix "tw-" for Tailwind to prevent classes colliding.
However, Laravel 8.x uses Tailwind by default unless set to use Bootstrap. Reference here.
Is there any way to let Laravel know about the Tailwind prefix that I set so that it uses the correct Tailwind class names?
Thanks in advance!
I wonder if it's truly necessary to use both tools for css.
Anyways I'm not entirely sure how you're loading the pagination, but you also have the ability to create your own (custom) pagination view.
By running the following code:
php artisan vendor:publish --tag=laravel-pagination
This command will place the views in your application's resources/views/vendor/pagination directory. The tailwind.blade.php file within this directory corresponds to the default pagination view. You may edit this file to modify the pagination HTML.
It might suite your needs a lot more to be able to have the pagination view file customized. Because with this you can recreate the pagination using Tailwind (or Bootstrap) classes.

Class not found despite composer dump autoload

Good day,
I am getting a class not found error on our website.
Class 'BootForm' not found
However when I checked the vendor directory, the files are there.
So I ran this command.
php artisan version
The site that uses the same dependency was this version.
Laravel Framework 5.5.23
The site that is not working was this version.
Laravel Framework 5.4.35
And when I check the files, the working site had this file.
bootstrap/cache/packages.php
Does that mean that I have to update the laravel version?
In laravel 5.5, a new feature was add called Package discovery
https://laravel.com/docs/5.5/packages#package-discovery
In laravel 5.4 you have to add your providers array located in the config/app.php file
that''s why you got an error on your 5.4 version and not in the 5.5 one :)

Does laravel has any gems to extend or modify functionality?

Does laravel has gems like as ruby on rails have? Like, for signup flow ruby on rails has "devise" gem. Does laravel has anything like that?
There is no built-in package manager for Laravel but you can use reference like: https://packalyst.com . Here you can find all available packages for Laravel. All of them can be installed with Composer - php package manager. There is detail description how to install every pack in Packalyst.
If you want to have auth in Laravel you have two options. To do it manually, or to use the built-in module for authentication. You can run
php artisan make:auth
in the main project directory. This will add the required views and routes in the Laravel file structure in order to use the auth. Better to run this command on fresh installation. See this for detailed step by step authentication with Laravel 5: https://laravel.com/docs/5.5/authentication#authentication-quickstart

Has Laravel 5.2 discontinued form model binding and helpers like Form::model?

I cannot locate any official help on the Laravel 5.2 docs, and the only way to use Form::model, and Form::open in my apps using Laravel 5.2 seems to use LaravelCollective.
Any ideas on what is the current best practice for form model binding in Laravel's latest version?
Since 5.0 Laravel Collection HTML & Forms became separated package which should be installed with composer.
If you're using Form or HTML helpers, you will see an error stating
class 'Form' not found or class 'Html' not found. The Form and HTML
helpers have been deprecated in Laravel 5.0; however, there are
community-driven replacements such as those maintained by the Laravel
Collective.
https://laravel.com/docs/master/upgrade#upgrade-5.0

Resources