Change method boot
use Carbon\Carbon;
public function boot()
{
config(['app.locale' => 'id']);
//my enviroment | |
// laravel 5.5 | |
//in web.php | |
Route::get('admin/get-merk-product/{id}','ProductController@getMerk'); | |
// in controller | |
use Response; | |
use App\MMerk; |
/blade view | |
<div class="row"> | |
<div class="col-md-12"> | |
<button type="button" name="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal"> <i class="fa fa-pencil"></i> Add Produk</button> | |
</div> | |
</div> | |
<div class="row"> | |
<div class="col-md-12"> | |
<table class="table table-inverse"> |
<?php $colors = ['bg-aqua','bg-green','bg-yellow','bg-red']; ?> | |
@foreach($dataGudang as $gudang) | |
<div class="col-lg-4 col-xs-8"> | |
<!-- small box --> | |
<div class="small-box {{ $colors[rand(0,3)] }}"> | |
</div> | |
</div> | |
@endforeach |
$data = []; | |
//ambil alamat asli customer | |
$customer = DB::table('m_customer')->select(DB::raw("CONCAT(m_customer.main_address,' - ',m_kelurahan_desa.name,' - ',m_kecamatan.name,' - ',m_kota_kab.type,' ',m_kota_kab.name) as address")) | |
->join('m_kelurahan_desa','m_kelurahan_desa.id','=','m_customer.main_kelurahan') | |
->join('m_kecamatan','m_kecamatan.id','=','m_kelurahan_desa.kecamatan') | |
->join('m_kota_kab','m_kota_kab.id','=','m_kecamatan.kota_kab') | |
->where('m_customer.id',$customerID) | |
->get(); | |
//mencari alamat lainnya customer di m_alamat_customer |
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> | |
<!-- Indicators --> | |
<ol class="carousel-indicators"> | |
@foreach( $trip->photos as $photo ) | |
<li data-target="#carousel-example-generic" data-slide-to="{{ $loop->index }}" class="{{ $loop->first ? 'active' : '' }}"></li> | |
@endforeach | |
</ol> | |
<!-- Wrapper for slides --> |
//view | |
<form action="you/url" method="get"> | |
//this chekcbox on loop | |
<input type="checkbox" name="id[]" value="{{$gallery->id}}" id="child" class="child"> | |
// chekcbox parent outside loop | |
<input type="checkbox" name="parent" id="parent"> | |
//submit form |
public function classes($teacherId) | |
{ | |
$teacherClass = | |
TeacherClass::join('m_class','m_class.id','m_teacher_class.class_id') | |
->select('m_teacher_class.class_id','m_class.name as name_class', | |
DB::raw("(select COUNT(*) from m_student where m_student.class_id = m_teacher_class.class_id ) as student") | |
) | |
->where('teacher_id',$teacherId)->get(); | |
dd($teacherClass); | |
} |
@extends('index') | |
@section('contentheader_title','Master User') | |
@section('customcss') | |
<link rel="stylesheet" href="{{ asset('/plugins/datatables/dataTables.bootstrap.css') }}"> | |
<link rel="stylesheet" href="{{ asset('/plugins/datatables/jquery.dataTables.min.css') }}"> | |
@endsection | |
@section('content') |
`DEFINE FUNCTION` | |
protected function getCode() | |
{ | |
/*PATTERN | |
'LINK' + year date + month date + '0000' | |
'0000' is generate number 4 digit | |
*/ | |