Example #1
0
 public function update($id = null)
 {
     $model = $this->model;
     $id = $id;
     if (count($_POST) > 0) {
         $record = $model::find($id);
         if ($record->validate($_POST)) {
             $record->save();
             header("Location: {$this->url}");
             exit;
         }
     }
     $form = \Gravel\Scaffolding::createEditForm($this->table, $this->model, $id);
     $this->loadView('utilities/genericUpdate', compact('form'));
 }
 public function update($id = null)
 {
     $id = $id;
     $user = User::find($id);
     if (count($_POST) > 0) {
         $password = $user->password;
         if ($user->validate($_POST)) {
             if ($password !== $user->password) {
                 $user->password = sha1($user->password);
             }
             $user->save();
             header("Location: {$_SERVER['HTTP_REFERER']}");
             exit;
         }
     }
     $form = \Gravel\Scaffolding::createEditForm($this->table, $this->model, $id);
     $this->loadView('utilities/genericUpdate', compact('id', 'user', 'form'));
 }
Example #3
0
<?php

use Gravel\Scaffolding;
?>
@extends('templates/admin')
@section('content')
@include('utilities/form-errors')
<?php 
echo Scaffolding::createEditForm('blog_posts', 'Blog', $id);
?>
@endsection
Example #4
0
<?php

use Gravel\Scaffolding;
?>
@extends('templates/admin')
@section('content')
@include('utilities/form-errors')
<?php 
echo Scaffolding::createInsertForm('blog_posts', 'Blog');
?>
@endsection
Example #5
0
<?php

use Gravel\Scaffolding;
?>
@extends('templates/admin')
@section('content')
@include('utilities/form-errors')
<?php 
echo Scaffolding::createInsertForm('brands', 'Brand');
?>
@endsection
Example #6
0
<?php

use Gravel\Scaffolding;
?>
@extends('templates/admin')
@section('content')
@include('utilities/form-errors')
<?php 
echo Scaffolding::createEditForm('users', 'User', $id);
?>
@endsection
Example #7
0
<?php

use Gravel\Scaffolding;
?>
@extends('templates/admin')
@section('content')
@include('utilities/form-errors')
<?php 
echo Scaffolding::createEditForm('brands', 'Brand', $id);
?>
@endsection
Example #8
0
<?php

use Gravel\Scaffolding;
?>

@extends('templates/admin')
@section('content')
@include('utilities/form-errors')
<?php 
echo Scaffolding::createInsertForm('users', 'User');
?>
@endsection