Download the PHP package whitecube/laravel-links without Composer

On this page you can find all versions of the php package whitecube/laravel-links. 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-links

Links for Laravel

🔗 No more broken internal links!
♻️ Changes made to route structures, model bindings, slugs, etc. are directly transposed to all URLs generated with this package ;
🎯 Display intuitive and exhaustive form fields for links selection ;
💾 Store references to simple or complex URLs where and how you want.

Laravel's routing system is great. With this package, it will become even greater! Using a simple link reference syntax, you'll be able to store and parse URLs on-the-fly and take full advantage of Laravel's routing in rich content such as CMS editors, admin interfaces and other managed configurations.

Building a content page and want to add the possibility to insert links to your application's resources (or even external!) from your admin panel? You basically have two options:

  1. Store the full URL as a string and hope it won't change soon:

  2. Store a short, immutable reference to this URL and let your application resolve its current, working URL at runtime:

You'll get it: the second one is probably the best. However, it can swiftly become quite complex to setup and maintain. That's why we've built a package for it.

Table of contents

  1. Installation
  2. Usage
  3. Registering link resolvers
  4. Editing & storing link references
  5. Resolving link URLs
    • Using the Link instantiation methods
    • Using the Links facade
    • Using the Str facade or str() helper
    • Using Blade directives
    • Using model attribute casting
  6. Reporting link resolving issues

Installation

This package will auto-register its service provider.

Usage

First, you'll need to register the application's link resolvers. Link resolvers are objects used to transform immutable link references (such as products.item@216) into fully qualified URLs. Resolvers can handle any of your application's routes or even complex external URLs. This package ships with a few common resolvers but feel free to create your own!

A good place to start is with a Service Provider. You can use an existing one (why not the application's RouteServiceProvider?) or create a dedicated Provider (e.g. LinkServiceProvider). Then, inside the provider's boot method, provide a resolver definition for each link you'll need to reference:

Of course, your application could have more complex routing configurations that would probably be more difficult to map into link resolvers. This package offers a lot of advanced resolver setup features that could cover your needs, but you can also extend the shipped traits or write your own resolvers.

You can now start resolving them for display.

Registering link resolvers

WIP.

Editing & storing link references

WIP.

Resolving link URLs

As stated above, links can be stored in many ways, depending on your use case. Here are a few common methods that should get you started.

Using the Link instantiation methods

WIP

Using the Links facade

WIP

Using the Str facade or str() helper

WIP

Using Blade directives

WIP

Using model attribute casting

Beware that model attribute casting can have undesired side-effects on dedicated link editor components since they'll probably rely on the attribute's raw value (meaning "with unresolved link references") to work.

Casting textual content with inline link references (inline tags)

The ResolvedInlineLinkTagsString cast is useful when a model has attributes containing editorial content with inline link references (also called "inline tags") that all need to be resolved at once.

For instance, a content attribute containing the following string:

Would be cast into:

Reporting link resolving issues

WIP.


Development Roadmap

Links are at the base of the world wide web. This package aims to "objectify" and take inventory of a project's internal URLs, which opens a lot of possibilites for future features and updates.

Need some of the unchecked features above? Or want to add items to this list? Open an issue or a PR and we'll take a look at it! But remember, if you want professional support, don't forget to sponsor us! 🤗

🔥 Sponsorships

If you are reliant on this package in your production applications, consider sponsoring us! It is the best way to help us keep doing what we love to do: making great open source software.

Contributing

Feel free to suggest changes, ask for new features or fix bugs yourself. We're sure there are still a lot of improvements that could be made, and we would be very happy to merge useful pull requests. Thanks!

Made with ❤️ for open source

At Whitecube we use a lot of open source software as part of our daily work. So when we have an opportunity to give something back, we're super excited!

We hope you will enjoy this small contribution from us and would love to Twitter for more updates!


All versions of laravel-links with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
laravel/framework Version ^10.40|^11.0
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 whitecube/laravel-links contains the following files

Loading the files please wait ....