예제 #1
0
 function getAdd()
 {
     $type = new \App\Type();
     $type->type = 'Sushi';
     $type->fc_adj = 0.07000000000000001;
     $type->lc_adj = -0.1;
     $type->save();
     foreach ($type->all() as $type) {
         echo $type->type;
     }
 }
예제 #2
0
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
// Front End Controller
Route::resource('/', 'frontEndController');
// Produk FrontEnd Route
Route::get('productFront', 'frontEndController@Produkpage');
// Produk FrontEnd Route
Route::get('productFront/{id}', 'frontEndController@ProdukDetail');
// Produk FrontEnd Filter
Route::get('productFront/tipe/{id}', function ($id = 0) {
    $produk = App\Type::find($id)->produk()->where('type_id', '=', $id)->get();
    $tipe = App\Type::all();
    return view('FrontEnd.product', compact('produk', 'tipe'));
});
// News FrontEnd Route
Route::get('news', 'frontEndController@newsPage');
// Gallery FrontEnd Route
Route::get('gallery', 'frontEndController@galleryPage');
// News Detail FrontEnd Route
Route::get('news/{id}', 'frontEndController@newsDetail');
// Contact Us Route
Route::get('contactUs', 'frontEndController@contactUs');
//Send Message from Contact Us Page
Route::post('sendMessage', 'frontEndController@sendMessage');
// About us Route
Route::get('aboutus', 'frontEndController@aboutUs');
// Authentication routes...
예제 #3
0
function navPrevNextwithType($id = 0, $model = "")
{
    $data = $model::findOrfail($id);
    $checkNext = $model::orderBy('id', 'desc')->first();
    // Ngecek data yang di show paling akhir atau engga
    // Kalau dia paling akhir maka tombol Next akan di Disabled
    if ($checkNext->id == $id) {
        $next = 0;
    } else {
        $next = $id + 1;
        while (is_null($model::find($next))) {
            $next++;
        }
    }
    // Ngecek data yang di show paling awal atau engga
    // Kalau dia paling awal maka tombol Prev akan di Disabled
    $checkPrev = $model::first();
    if ($checkPrev->id == $id) {
        $prev = 0;
    } else {
        $prev = $id - 1;
        while (is_null($model::find($prev))) {
            $prev--;
        }
    }
    $tipe = App\Type::all();
    return $array = array('data' => $data, 'prev' => $prev, 'next' => $next, 'tipe' => $tipe);
}
예제 #4
0
 * Define an Enhancement
 */
$factory->define(App\Enhancement::class, function ($faker) {
    return ['name' => $faker->catchPhrase, 'short_desc' => $faker->paragraph(3), 'img_src' => $faker->imageUrl()];
});
/**
 * Define an Initiative
 */
$factory->define(App\Initiative::class, function ($faker) {
    return ['name' => $faker->catchPhrase, 'country' => $faker->countryCode, 'started_at' => $faker->dateTimeThisYear()];
});
/**
 * Define an InitiativeType
 */
$factory->define(App\InitiativeType::class, function ($faker) {
    return ['amount' => $faker->numberBetween(500, 100000), 'initiative_id' => $faker->randomElement(App\Initiative::lists('id')->toArray()), 'type_id' => $faker->randomElement(App\Type::lists('id')->toArray())];
});
/**
 * Define an Initiative Type Date
 */
$factory->define(App\InitiativeTypeDate::class, function ($faker) {
    return ['launched_at' => $faker->dateTimeThisYear(), 'half_due_at' => $faker->dateTimeThisYear(), 'full_due_at' => $faker->dateTimeThisYear(), 'latest_start_at' => $faker->dateTimeThisYear()];
});
/**
 * Define a Representative
 */
$factory->define(App\Representative::class, function ($faker) {
    return ['name' => $faker->name, 'email' => $faker->email, 'phone' => $faker->phoneNumber];
});
/**
 * Define a Note