Download the PHP package barryvdh/laravel-form-bridge without Composer

On this page you can find all versions of the php package barryvdh/laravel-form-bridge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-form-bridge

Laravel Form Bridge

See http://symfony.com/doc/current/forms.html

Laravel integration:

Install

Basic example

You can use the FormFactory to create a form. You can supply a Model as data, so it will fill the values.

You can use $form->handleRequest($request); to update the values in the user, or you can just use $request object or Input facade like usual. However, by default, the form is grouped under a form key, so you have to use $request->get('form') to get the form values. Or you can create a Named form, with an empty name.

If you need to set more options, use the createBuilder function instead of create, to be able to use setAction() etc. You need to call ->getForm() to get the actual form instance again.

Use the following in your Blade templates:

Other directives are: @form, @formLabel, @formErrors, @formRest and @formRow

Or use the following in your Twig templates to render the view:

See http://symfony.com/doc/current/book/forms.html#form-rendering-template for more options.

Traits

To make it easier to use in a Controller, you can use 2 traits:

ValidatesForms: Adds a validation method, similar to the ValidatesRequests trait: $this->validateForm($form, $request, $rules)

CreatesForms: Create a Form or FormBuilder:

Creating a named form:

See http://symfony.com/doc/current/book/forms.html for more information.

BelongsToMany relations

BelongsToMany behaves differently, because it isn't an actual attribute on your model. Instead, we can set the mapped option to false and sync it manually.

See for more options the choice type documentation.

Note: The BelongsToManyType is deprecated in favor of the ChoiceType from Symfony.

Translation labels

If you want to translate your labels automatically, just pass the translation key as the label attribute. It will run throught Twig's trans filter.

Uploading Files

You can use the file type in the FormBuilder, and use the magic getFile() and setFile() method on your Model or mark it as not mapped, so you can handle it yourself. See http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html

Extending

You can extend some of the arrays in the ServiceProvider, eg. to add Types, add this to the register() method in your own ServiceProvider:


All versions of laravel-form-bridge with dependencies

PHP Build Version
Package Version
Requires php Version ^8
illuminate/support Version ^9|^10|^11.0
symfony/form Version ^6|^7.0
symfony/validator Version ^6|^7.0
symfony/twig-bridge Version ^6|^7.0
twig/twig Version ^3.3.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package barryvdh/laravel-form-bridge contains the following files

Loading the files please wait ....