AbdullahGhanem / ajax-blade by ghanem

Easy AJAX with blade
143
10
3
Package Data
Maintainer Username: ghanem
Maintainer Contact: 3bdullah.ghanem@gmail.com (abdullah-ghanem)
Package Create Date: 2015-10-10
Package Last Update: 2015-10-11
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-11-11 15:24:02
Package Statistics
Total Downloads: 143
Monthly Downloads: 1
Daily Downloads: 1
Total Stars: 10
Total Watchers: 3
Total Forks: 3
Total Open Issues: 1

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>