Download the PHP package mojahed/spa without Composer

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

mojahed/spa

A Laravel SPA package powered by Alpine.js, Axios, and Bootstrap — no build step, no npm, no Vite. Load blade fragments dynamically, manage modals, offcanvases, and independent page sections with clean declarative components.


Requirements


Installation

Publish and copy assets to your public directory:

Optionally publish config and views for customization:


Layout Setup

Add directives to your main layout file:

Use a custom Alpine component name:

Then define it in your scripts:


Directives

Directive Output
@spacss CSS link tags (Bootstrap + spa.css)
@spajs JS script tags (Alpine, Axios, Bootstrap, SweetAlert2, spa.js) + CSRF headers
@spadata x-data="spa()" on body
@spadata('name') x-data="name()" on body

Components

<x-spa-target> — Inline Fragment Zone

Loads a blade fragment into an inline div. Optionally auto-loads on page ready.

Props

Prop Default Description
id required Unique ID
url '' URL to fetch
auto-load false Load on page ready
loader-type config default spinner | skeleton | table | card
loader-rows 5 Skeleton/table rows
loader-cols 4 Table columns
method get HTTP method
params [] Query params array

<x-spa-modal> — Bootstrap Modal Container

Props

Prop Default Description
id required Unique ID
size lg sm | md | lg | xl | fullscreen
title '' Modal title
loader-type config default Loader type while loading
static-backdrop true Prevent close on outside click
scrollable false Scrollable modal body

<x-spa-offcanvas> — Bootstrap Offcanvas Container

Props

Prop Default Description
id required Unique ID
title '' Header title
placement end start | end | top | bottom
width 450px Width (end/start only)
loader-type config default Loader type while loading

<x-spa-btn> — Button Trigger

Props

Prop Default Description
url '' Target URL
method get HTTP method
target '' Load into #spa-target id
modal '' Load into modal id
offcanvas '' Load into offcanvas id
confirm false Show confirm dialog first
confirm-title config Confirm dialog title
confirm-text config Confirm dialog body text
confirm-type warning SweetAlert icon type
confirm-ok config Confirm button label
confirm-cancel config Cancel button label
on-success-reload '' Reload target by #id
on-success-close '' Close modal/offcanvas by #id
on-success-toast '' Show success toast message
on-success-redirect '' Redirect to URL
on-success-emit '' Dispatch custom Alpine event

<x-spa-link> — Anchor Trigger

Same props as <x-spa-btn>, renders as an <a> tag.


<x-spa-form> — Axios Form Submit

Handles form submission with error binding and submitting state. Pass initial field values through :data and bind inputs with x-model="{model}.{field}".

Props

Prop Default Description
url required Submit URL
method post HTTP method
model form Name of the Alpine data object holding the fields
:data [] Initial field values, e.g. :data="['name' => $item->name]"

<x-spa-loader> — Standalone Loader


Dashboard — Independent Sections

Each section loads independently with its own loader, just like the AWS dashboard:


Controller — Fragment Detection

Use Laravel's built-in fragment system with the X-SPA-Request header automatically sent by the package:

Or directly with Laravel's fragmentIf:


JS Utilities

All utilities are globally available:


Configuration

Publish and edit config/spa.php:


Legacy Compatibility

If you are migrating from existing code that uses toast(), setParam(), getParam(), runScriptCode() — these are aliased to the new spa* functions so your existing code continues to work without changes.


License

MIT — Md. Mojahedul Islam


All versions of spa with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
illuminate/support Version ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/view Version ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.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 mojahed/spa contains the following files

Loading the files please wait ...