Download the PHP package ralphjsmit/livewire-urls without Composer

On this page you can find all versions of the php package ralphjsmit/livewire-urls. 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 livewire-urls

livewire-urls

Get the current and previous url in Livewire.

This package gives you a simple way to retrieve the current and previous URL in Livewire.

Unfortunately, Laravel or Livewire cannot handle this for you, since Livewire also makes requests to your server when a user interacts with your webpage. This means that the usual methods like URL()->current() point to an internal Livewire route, instead of the "real route" your user is on.

This package provides you with a middleware and helper methods to determine which URL is currently being used.

Installation

You can install the package via composer:

Next, you should add \RalphJSmit\Livewire\Urls\Middleware\LivewireUrlsMiddleware::class, to your Http Kernel.php, in the web key of the $middlewareGroups property.

Usage

Current url

Current route

The Url::currentRoute() returns null when the user is on a route without a name.

Previous url

The Url::previous()-method returns null when there isn't a previous route available.

Previous route

The Url::previousRoute() returns null when there isn't a previous route or if the previous route wasn't a named route.

Last recorded url

You can use the Url::lastRecorded() method to get the last url from the history that is different from the current url.

For example:

  1. User visits page A
  2. User visits page B
  3. User visits page B

The Url::lastRecorded() would give you the url of page A. The function returns null when there isn't an other url found, apart from the current session.

Last recorded route

You can use the Url::lastRecordedRoute() method to get the last route from the history that is different from the current url/route.

The Url::lastRecordedRoute() would give you the route of page A from the previous example, if page A is on a named route. Otherwise, it would return null. The function also returns null when there isn't an other url found, apart from the current session.

General

🐞 If you spot a bug, please submit a detailed issue and I'll try to fix it as soon as possible.

🔐 If you discover a vulnerability, please review our security policy.

🙌 If you want to contribute, please submit a pull request. All PRs will be fully credited. If you're unsure whether I'd accept your idea, feel free to contact me!

🙋‍♂️ Ralph J. Smit


All versions of livewire-urls with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/contracts Version ^8.83|^9.0|^10.0|^11.0|^12.0
livewire/livewire Version ^2.10|^3.0
spatie/laravel-package-tools Version ^1.9.2
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 ralphjsmit/livewire-urls contains the following files

Loading the files please wait ....