ghanem/ajaxblade

Easy AJAX with blade

0.2.2 2015-10-11 00:48 UTC

This package is auto-updated.

Last update: 2024-12-16 22:48:43 UTC


README

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>