ghanem/ajaxblade

Easy AJAX with blade
144 10
Install
composer require ghanem/ajaxblade
Latest Version:0.2.2
PHP:>=5.5.9
License:MIT
Last Updated:Oct 11, 2015
Links: GitHub  ·  Packagist
Maintainer: ghanem

Easy AJAX with blade

Installation

First, pull in the package through Composer.

"require": {
	"ghanem/ajaxblade": "0.2.*"
}

or use.

composer require ghanem/ajaxblade

if using Laravel 5, include the service provider within config/app.php.

'providers' => [
    'Ghanem\Ajaxblade\AjaxbladeServiceProvider'
];

now run this comand:

php artisan vendor:publish

Example

Within your controllers, before you perform a redirect...

public function show()
{
    $articles = Article::orderBy('id', 'DESC')->Paginate(20);

    return view('home',compact('articles'));
}

this is home view :

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
	<script src="//code.jquery.com/jquery.js"></script>
	<script src="{{ public_path('vendor/ajaxblade/ajaxblade.js') }}"></script>
</head>
<body>

<div class="container">
	
	
	<div class="abs">
		@foreach ($users as user)
			<div> $user->name </div>
		@endforeach
		@ajaxblade($users)
	</div>

</div>

</body>
</html>

Related Packages

spatie/laravel-blade-javascript

A Blade directive to export variables to JavaScript

928,291 620
philo/laravel-blade

Use the simple and yet powerful Laravel Blade templating engine as a standalone...

682,786 355
arrilot/laravel-widgets

A powerful alternative to view composers. Asynchronous widgets, reloadable widge...

4,805,255 1,115
igaster/laravel-theme

Laravel Themes: Asset & Views folder per theme. Theme inheritance. Blade integra...

1,257,366 515
fitztrev/laravel-html-minify

Minifies the HTML output of Laravel 4 applications

214,711 415