Laravel

Create role and permission (Using Entrust) in Laravel

Long time not write blog again, and now I want share how to add permission user using entrust. Okay for the installation, follow the steps below:
First open your laravel project and add this code to your composer:

"require": {
		"laravel/framework": "4.*",
		"barryvdh/laravel-debugbar": "dev-master",
		"zizaco/entrust": "dev-master"
	},

After that, run composer update:

$ composer update

If update succesfully, now open your app.php from your laravel config:
(more…)

Laravel 4 create PDF (use dompdf)

After not updating this blog for a few days, now I want to share how to create PDF in laravel using dompdf package from https://github.com/barryvdh/laravel-dompdf. Ok for installation follow this steps:
First we must add the barryvdh/laravel-dompdf to the composer with command:

aim@linux-yr22:~$ composer require barryvdh/laravel-dompdf:* --no-update
aim@linux-yr22:~$ composer update

Then we must add service provider to app/config/app.php:

	'providers' => array(

		'Illuminate\Foundation\Providers\ArtisanServiceProvider',
		'Illuminate\Auth\AuthServiceProvider',
		'Illuminate\Cache\CacheServiceProvider',
		'Illuminate\Session\CommandsServiceProvider',
		'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
		'Illuminate\Routing\ControllerServiceProvider',
		'Illuminate\Cookie\CookieServiceProvider',
		'Illuminate\Database\DatabaseServiceProvider',
		'Illuminate\Encryption\EncryptionServiceProvider',
		'Illuminate\Filesystem\FilesystemServiceProvider',
		'Illuminate\Hashing\HashServiceProvider',
		'Illuminate\Html\HtmlServiceProvider',
		'Illuminate\Log\LogServiceProvider',
		'Illuminate\Mail\MailServiceProvider',
		'Illuminate\Database\MigrationServiceProvider',
		'Illuminate\Pagination\PaginationServiceProvider',
		'Illuminate\Queue\QueueServiceProvider',
		'Illuminate\Redis\RedisServiceProvider',
		'Illuminate\Remote\RemoteServiceProvider',
		'Illuminate\Auth\Reminders\ReminderServiceProvider',
		'Illuminate\Database\SeedServiceProvider',
		'Illuminate\Session\SessionServiceProvider',
		'Illuminate\Translation\TranslationServiceProvider',
		'Illuminate\Validation\ValidationServiceProvider',
		'Illuminate\View\ViewServiceProvider',
		'Illuminate\Workbench\WorkbenchServiceProvider',
		'Barryvdh\Debugbar\ServiceProvider',
		'Barryvdh\DomPDF\ServiceProvider',
	),

Then add Facade for shorter code. What facade? I will explain later in below paragraph.
(more…)

Create One Blade Template (Layout) for All page in Laravel 4

Okay for long time, I will update the blog content and now I want to share how to create one base template or one layout for all page in my laravel framework. The structure might look like this:

And now the first we must change the head.blade.php like this (I using bootstrap):

<title>Simple Project</title>
<meta charset="utf-8">
<meta name="description" content="Simpel Project">
<meta name="Imron Rosdiana" content="Simple Project">

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">

<!-- Jquery -->
<script src="//code.jquery.com/jquery-2.1.1.min.js" type="text/javascript"></script>

Explanations:
(more…)

Adding Laravel Debugbar like Symfony2 debugbar.

Hello I’am back again for long time.. :D, sory for long time and wait your time to see my new post. I’am sory, now I’ve some problem with my homework and now I’m working on my thesis. I hope you understand this. I’am is only one administrator on this blog and I was a student in one of the colleges, so I’ve many homeworks 🙂 So if you want to help me and join in with being the author of this blog, then please email me at imron_tux@yahoo.com.
Okay back to the topic, we now Symfony2 from default have profiler or panel debugbar on the bottom page if we run on development site like this:
.
And now laravel have plugin similiar symfony2, I got it from here https://github.com/barryvdh/laravel-debugbar. And this how to install the debugbar on Laravel:
The first open your composer.json on your laravel, example composer.json me:
(more…)

Bootstrap 3.1 load tab content using ajax (external view) on laravel 4.1

Ok now I want create a tutorial about how to load external view using ajax on laravel. Okay we just started the tutorial. 🙂
The first, I assume You have to install the laravel framework. If not, You can follow from this link http://laravel.com/docs/installation, after that, now I assume you have download Bootstrap from twitter and latest jquery from this site. http://getbootstrap.com/ and this http://jquery.com/. Ok after all has been downloaded, now open your laravel framework on your editor text.
Okay the first paste all jquery and bootstrap to public/assets like this:

And then, create file on your app/views with name home.php and fill the code like this:
(more…)