Skip to content

Commit

Permalink
Add functions
Browse files Browse the repository at this point in the history
  • Loading branch information
hcancakici committed May 19, 2017
1 parent 0f06484 commit ef42da6
Show file tree
Hide file tree
Showing 18 changed files with 320 additions and 140 deletions.
4 changes: 3 additions & 1 deletion app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class LoginController extends Controller
*
* @var string
*/
protected $redirectTo = '/home';
protected $redirectTo = '/index';

/**
* Create a new controller instance.
Expand All @@ -36,4 +36,6 @@ public function __construct()
{
$this->middleware('guest')->except('logout');
}


}
28 changes: 0 additions & 28 deletions app/Http/Controllers/HomeController.php

This file was deleted.

19 changes: 16 additions & 3 deletions app/Http/Controllers/MalzemeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,28 @@
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Malzeme;

class MalzemeController extends Controller
{
public function index()
{
$malzemeler = \App\Malzeme::all()->toArray();
$malzemeler = \App\Malzeme::all()->sortBy('timestamp');
return view('malzeme/index', ['malzemeler' => $malzemeler]);
}
}

public function store(Request $request)
{
$malzeme = new \App\Malzeme;

$malzeme->ad = $request['ad'];
$malzeme->miktar = $request['miktar'];

$malzeme->save();

$malzemeler = \App\Malzeme::all()->sortBy('timestamp');

return view('malzeme/index', ['malzemeler' => $malzemeler]);
}

public function add() {
return view('malzeme/add');
Expand Down
27 changes: 25 additions & 2 deletions app/Http/Controllers/PersonelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,29 @@ class PersonelController extends Controller
//
public function index()
{
return view('personel/index');
}
$personeller = \App\Personel::all()->sortBy('timestamp');

return view('personel/index', ['personeller' => $personeller]);
}

public function add()
{
return view('personel/add');
}

public function store(Request $request)
{
$personel = new \App\Personel;

$personel->tc = $request['tc'];
$personel->ad = $request['isim'];
$personel->soyad = $request['soyisim'];

$personel->save();

$personeller = \App\Personel::all()->sortBy('timestamp');

return view('personel/index', ['personeller' => $personeller]);
}

}
24 changes: 22 additions & 2 deletions app/Http/Controllers/UrunController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,26 @@ class UrunController extends Controller

public function index()
{
return view('urun/index');
}
$urunler = \App\Urun::all()->sortBy('timestamp');
return view('urun/index', ['uruneler' => $urunler]);
}

public function store(Request $request)
{
$urun = new \App\Urun;

$urun->ad = $request['ad'];
$urun->fiyat = $request['miktar'];

$urun->save();

$urunler = \App\Urun::all()->sortBy('timestamp');

return view('urun/index', ['urunler' => $urunler]);
}

public function add() {
$malzemeler = \App\Urun::all();
return view('urun/add', ['malzemeler' => $malzemeler]);
}
}
8 changes: 7 additions & 1 deletion app/Personel.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@

class Personel extends Model
{


protected $fillable=[
'ad',
'soyad',
'tc'
];

public function siparis()
{
return $this->hasMany(Siparis::class);
Expand Down
3 changes: 2 additions & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Providers;

use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
Expand All @@ -13,7 +14,7 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
//
Schema::defaultStringLength(191);
}

/**
Expand Down
Loading

0 comments on commit ef42da6

Please sign in to comment.