bantenprov/laravel-opd

Repository untuk membuat melakukan proses data Organisasi Perangkat Daerah

v1.0.2 2018-05-11 11:47 UTC

This package is not auto-updated.

Last update: 2024-11-10 05:40:25 UTC


README

Join the chat at https://gitter.im/laravel-opd Scrutinizer Code Quality Build Status Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads

Laravel OPD

Repository untuk membuat atau melakukan proses data Organisasi Perangkat Daerah

DEMO

Demo for this package is available here OPD.

Install Laravel :

$ composer create-project --prefer-dist laravel/laravel project-name "5.4.*"

Install package :

$ composer require bantenprov/laravel-opd:dev-master

Edit config/app.php

If you use laravel 5.4

providers

'providers' => [
    ...
    App\Providers\AppServiceProvider::class,
    App\Providers\AuthServiceProvider::class,
    App\Providers\EventServiceProvider::class,
    App\Providers\RouteServiceProvider::class,
    ...
    
    Bantenprov\LaravelOpd\LaravelOpdServiceProvider::class,
    Emadadly\LaravelUuid\LaravelUuidServiceProvider::class,

aliases

'aliases' => [
    ...
    'Storage' => Illuminate\Support\Facades\Storage::class,
    'URL' => Illuminate\Support\Facades\URL::class,
    'Validator' => Illuminate\Support\Facades\Validator::class,
    'View' => Illuminate\Support\Facades\View::class,
    ...
    'Opd' => Bantenprov\LaravelOpd\Facades\LaravelOpd::class,

Artisan command :

$ php artisan vendor:publish --tag=migrations
$ php artisan vendor:publish --tag=views
$ php artisan vendor:publish --provider="Emadadly\LaravelUuid\LaravelUuidServiceProvider"

Edit config/uuid.php

Change 'default_uuid_column' => 'uuid' to 'default_uuid_column' => 'id'

'default_uuid_column' => 'id',

Edit "vendor/kalnoy/nestedset/src/NestedSet.php"

Change $table->unsignedInteger(self::PARENT_ID)->nullable(); to $table->string(self::PARENT_ID)->nullable();

public static function columns(Blueprint $table)
{
    $table->unsignedInteger(self::LFT)->default(0);
    $table->unsignedInteger(self::RGT)->default(0);
    $table->string(self::PARENT_ID)->nullable();

    $table->index(static::getDefaultColumns());
}

Run artisan command :

$ php artisan migrate

Check route list

run artisan command -> $ php artisan route:list

Add to routes/web.php

//web.php
Route::get('/opd/tree', function () {
    return Opd::tree();
})->name('opd.tree');

Route::get('/opd', function () {
    $opds =  Opd::index();
    return view('laravel-opd::unit_kerja.index',compact('opds'));
})->name('opd.index');

Route::get('/opd/create-root',function(){
    return view('laravel-opd::unit_kerja.create-root');
})->name('opd.create_root');

Route::get('/opd/create-child',function(){
    $unit_kerjas =  Opd::index();
  
    return view('laravel-opd::unit_kerja.create-child',compact('unit_kerjas'));
})->name('opd.create_child');

Contoh pengunaan :

1.

Output :

- 000100000000000 - Sekretariat Daerah
-- 000101000000000 - Asisten Pemerintahan dan Kesejahteraan Rakyat
--- 000101010000000 - Biro Pemerintahan
- 001500000000000 - Dinas Komunikasi, Informatika, Statistik dan Persandian
// web.php
Route::get('/opd', function () {
    return Opd::tree();
});

2.

// web.php
Route::get('/opd/create-root','\Bantenprov\LaravelOpd\Http\Controllers\LaravelOpdController@createRoot')->name('createRoot');

3.

//web.php
Route::get('/opd', function () {
    return view('laravel-opd::unit_kerja.create-root');
});

4.

1. http://127.0.0.1:8000/laravel-opd/
2. http://127.0.0.1:8000/laravel-opd/create-root
3. http://127.0.0.1:8000/laravel-opd/create-child

TODO :

Untuk keterangan lebih lanjut silahkan lihat di halaman wiki. Untuk berdiskusi silahkan sampaikan saran, pertanyaan, atau keperluan teknis lainnya silahkan disini.