Download the PHP package kamrava/laravel-spfjs without Composer

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

Laravel SPF.js

Laravel 5.x Latest Version License

Laravel SPF

Integrating SPF.js with Laravel

For Laravel 5.x

Laravel SPF package allows to bring awesome SPF.js to your Laravel app. Here is a description from SPF.js official doc :

Structured Page Fragments — or SPF for short — is a lightweight JS framework for fast navigation and page updates from YouTube.

Using progressive enhancement and HTML5, SPF integrates with your site to enable a faster, more fluid user experience by updating just the sections of the page that change during navigation, not the whole page. SPF provides a response format for sending document fragments, a robust system for script and style management, an in-memory cache, on-the-fly processing, and more.

Demo

Demo Source Code

Installation

  1. Install with composer:

  2. Open your config/app.php and add the following to the providers array:

  3. In the same config/app.php and add the following to the aliases array:

  4. Run the command below to publish the package asset files:

And that's it! Start building out some awesome and fast Laravel app!

Get Started

Blade Files Structure

As you know each HTML page consists of:

head for meta tags as well as styles and title and etc..

body for your page body

script for javascript files

Most probably you were using some structure like this:

And the file's content would be something like this :

Right? Ok, for using SPF.js in you Laravel app you need to break them into separate files and put them into sections directory as below :

Then put each section content into related blade file. For instance the content of ـhead.blade.php must be:

And so on for other sections.

Now, we have to combine them into two separate files! One for when SPF is not enabled for any reasons! and the other for when SPF is enabled :

First index.blade.php which located in : (For when SPF.js is not enabled)

with this content :

And spf_json.blade.php whcih located in : (For when SPF.js is enabled)

with this content :

main-content in the above code means we have a div with id main-content in the body tag

Cool, lets have a look at our master page which probably located here :

with this content :

Send requests

SPF does not change your site's navigation automatically and instead uses progressive enhancement to enable dynamic navigation for certain links. Just add a spf-link class to an tag to activate SPF.

Return responses

In dynamic navigation, only fragments are sent, using JSON as transport. When SPF sends a request to the server, it appends a configurable identifier to the URL so that your server can properly handle the request. (By default, this will be ?spf=navigate)

AdminController.php

Finally don't forget to load asset file in your scripts part of your master page!

Boom! It's Done!

Browser Support

To use dynamic navigation, SPF requires the HTML5 History API. This is broadly supported by all current browsers, including Chrome 5+, Firefox 4+, and IE 10+.

Credits

Maintainers:

  1. [Hamed Kamrava](https://github.com/kamrava

  2. ...

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-spfjs with dependencies

PHP Build Version
Package Version
No informations.
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 kamrava/laravel-spfjs contains the following files

Loading the files please wait ....