Tagged: Laravel

0

Laravel Named Routes

Route::get(‘master/division/all’, [‘as’=>’all_division’,’uses’=>’MasterController@division_index’]); Route::get(‘master/division/add’, [‘as’=>’add_division’,’uses’=>’MasterController@division_add’]); Route::post(‘master/division/save’, [‘as’=>’save_division’,’uses’=>’MasterController@division_save’]); Route::get(‘master/division/edit/{id}’, [‘as’=>’edit_division’,’uses’=>’MasterController@division_edit’]); Route::post(‘master/division/update’, [‘as’=>’update_division’,’uses’=>’MasterController@division_update’]); Route::get(‘master/division/delete/{id}’, [‘as’=>’delete_division’,’uses’=>’MasterController@division_delete’]); Route::get(‘master/level/all’, [‘as’=>’all_level’,’uses’=>’MasterController@level_index’]); Route::get(‘master/level/add’, [‘as’=>’add_level’,’uses’=>’MasterController@level_add’]); Route::post(‘master/level/save’, [‘as’=>’save_level’,’uses’=>’MasterController@level_save’]); Route::get(‘master/level/edit/{id}’, [‘as’=>’edit_level’,’uses’=>’MasterController@level_edit’]); Route::post(‘master/level/update’, [‘as’=>’update_level’,’uses’=>’MasterController@level_update’]); Route::get(‘master/level/delete/{id}’, [‘as’=>’delete_level’,’uses’=>’MasterController@level_delete’]); Route::get(‘master/employeer/all’, [‘as’=>’all_employeer’,’uses’=>’MasterController@employeer_index’]); Route::get(‘master/employeer/add’, [‘as’=>’add_employeer’,’uses’=>’MasterController@employeer_add’]); Route::post(‘master/employeer/save’, [‘as’=>’save_employeer’,’uses’=>’MasterController@employeer_save’]); Route::get(‘master/employeer/edit/{id}’, [‘as’=>’edit_employeer’,’uses’=>’MasterController@employeer_edit’]); Route::post(‘master/employeer/update’, [‘as’=>’update_employeer’,’uses’=>’MasterController@employeer_update’]);...

0

PHP Laravel save data dengan upload file

$gambar = “”; $divisi = new Divisi; $divisi->nama = Input::get(‘nama’); if(Input::hasFile(‘gambar’) and Input::file(‘gambar’)->isValid()){ $gambar = date(“YmdHis”) .uniqid() .”.” .Input::file(‘gambar’)->getClientOriginalExtension(); Input::file(‘gambar’)->move(storage_path().’/gambardivisi’,$gambar); } $divisi->gambar = $gambar; $divisi->keterangan = Input::get(‘keterangan’); $divisi->save();

0

PHP Laravel update data dengan upload file

$gambar = “”; $divisi = Divisi::where(‘id’,Input::get(‘id’))->first(); $divisi->nama = Input::get(‘nama’); if(Input::hasFile(‘gambar’) and Input::file(‘gambar’)->isValid()){ $gambar = date(“YmdHis”) .uniqid() .”.” .Input::file(‘gambar’)->getClientOriginalExtension(); Input::file(‘gambar’)->move(storage_path().’/gambardivisi’,$gambar); $divisi->gambar = $gambar; } $divisi->keterangan = Input::get(‘keterangan’); $divisi->save();

0

PHP Laravel Route Group

Route::group([‘prefix’ => ‘marketing’], function() { Route::group([‘prefix’ => ‘force’], function() { Route::group([‘prefix’ => ‘preferences’], function() { Route::group([‘prefix’ => ‘customer’], function() { Route::group([‘prefix’ => ‘trigger’], function() { Route::get(‘all’, ‘PreferencesController@trigger_customer_all’); Route::get(‘add’, ‘PreferencesController@trigger_customer_add’); Route::post(‘add’, ‘PreferencesController@trigger_customer_save’); }); }); });...

0

PHP Laravel Logdata Migration

<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateLogdatasTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create(‘logdatas’, function(Blueprint $table) { $table->increments(‘id’); $table->integer(‘idpengguna’); $table->string(‘ip’); $table->string(‘url’); $table->text(‘user_agent’); $table->int(‘ip_port’);...

0

PHP Laravel Logdata Function

public function logging($save=0) { $table = new \App\Logdata; $table->idpengguna = Auth::check()?Auth::user()->id:0; $table->ip = $_SERVER[‘REMOTE_ADDR’]; $table->url = url(); $table->user_agent = isset($_SERVER[‘HTTP_USER_AGENT’])?$_SERVER[‘HTTP_USER_AGENT’]:””; $table->ip_port = isset($_SERVER[‘REMOTE_PORT’])?$_SERVER[‘REMOTE_PORT’]:””; $table->http_host = isset($_SERVER[‘HTTP_HOST’])?$_SERVER[‘HTTP_HOST’]:””; $table->pathinfo = isset($_SERVER[‘REQUEST_URI’])?$_SERVER[‘REQUEST_URI’]:””; $table->http_referrer = isset($_SERVER[‘HTTP_REFERER’])?$_SERVER[‘HTTP_REFERER’]:””; $table->request_method =...

0

PHP Laravel routes.php mandrill send email

Route::get(‘/mandrill’,function () { $a = new Mandrill(“APP_KEY”); $message = array( ‘html’ => ‘<p>halo kalian semua</p>’, ‘text’ => ‘halo kalian semua,’, ‘subject’ => ‘baca dulu, jangan dihapus’, ‘from_email’ => ‘a@setya.me’, ‘from_name’ => ‘Arief Setya’, ‘to’...

0

PHP Laravel routes.php Trigger Conditional

Route::get(‘/da/{type}/{operan}/{kondisi}/{aksi}/{data}’,function ($type,$operan,$kondisi,$aksi,$data) { if($type==”trx”){ if($operan==”=”){ if($kondisi==$data){ echo “trx ok”; }else{ echo “trx nok”; } }elseif($operan==”<“){ if($kondisi<$data){ echo “trx ok”; }else{ echo “trx nok”; } }elseif($operan==”>”){ if($kondisi>$data){ echo “trx ok”; }else{ echo “trx nok”; }...

0

HTML PHP Laravel Default app.blade.php

<!DOCTYPE html> <html> <head> <meta charset=”utf-8″> <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> <title>Arief Setya</title> <!– Tell the browser to be responsive to screen width –> <meta content=”width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no” name=”viewport”> <!– Bootstrap 3.3.5 –> <link rel=”stylesheet”...