├── .env.example
├── .gitattributes
├── .gitignore
├── _ide_helper.php
├── app
├── Console
│ └── Kernel.php
├── Exceptions
│ └── Handler.php
├── Handlers
│ └── LfmConfigHandler.php
├── Http
│ ├── Controllers
│ │ ├── AnasayfaController.php
│ │ ├── Controller.php
│ │ ├── KategoriController.php
│ │ ├── KullaniciController.php
│ │ ├── OdemeController.php
│ │ ├── SepetController.php
│ │ ├── SiparisController.php
│ │ ├── UrunController.php
│ │ └── Yonetim
│ │ │ ├── AnasayfaController.php
│ │ │ ├── KategoriController.php
│ │ │ ├── KullaniciController.php
│ │ │ ├── SiparisController.php
│ │ │ └── UrunController.php
│ ├── Kernel.php
│ └── Middleware
│ │ ├── EncryptCookies.php
│ │ ├── RedirectIfAuthenticated.php
│ │ ├── TrimStrings.php
│ │ ├── TrustProxies.php
│ │ ├── VerifyCsrfToken.php
│ │ └── Yonetim.php
├── Mail
│ └── KullaniciKayitMail.php
├── Models
│ ├── Ayar.php
│ ├── Kategori.php
│ ├── Kullanici.php
│ ├── KullaniciDetay.php
│ ├── Sepet.php
│ ├── SepetUrun.php
│ ├── Siparis.php
│ ├── Urun.php
│ └── UrunDetay.php
├── Providers
│ ├── AppServiceProvider.php
│ ├── AuthServiceProvider.php
│ ├── BroadcastServiceProvider.php
│ ├── EventServiceProvider.php
│ └── RouteServiceProvider.php
└── helpers.php
├── artisan
├── bootstrap
├── app.php
└── cache
│ └── .gitignore
├── composer.json
├── composer.lock
├── config
├── app.php
├── auth.php
├── broadcasting.php
├── cache.php
├── cart.php
├── database.php
├── filesystems.php
├── hashing.php
├── lfm.php
├── logging.php
├── mail.php
├── queue.php
├── services.php
├── session.php
└── view.php
├── database
├── .gitignore
├── factories
│ └── UserFactory.php
├── migrations
│ ├── 2017_10_17_183408_create_kategori_table.php
│ ├── 2017_10_29_114953_create_urun_table.php
│ ├── 2017_11_02_170735_create_kategori_urun_table.php
│ ├── 2017_11_05_101237_create_urun_detay_table.php
│ ├── 2017_11_10_191439_create_kullanici_table.php
│ ├── 2017_11_17_200454_create_sepet_table.php
│ ├── 2017_11_19_184606_create_sepet_urun_table.php
│ ├── 2017_11_26_131901_create_siparis_table.php
│ ├── 2017_11_26_133711_create_kullanici_detay_table.php
│ └── 2018_06_19_194441_create_ayar_table.php
└── seeds
│ ├── DatabaseSeeder.php
│ ├── KategoriTableSeeder.php
│ ├── KullaniciTableSeeder.php
│ └── UrunTableSeeder.php
├── laravel_ecommerce.sql
├── package-lock.json
├── package.json
├── phpunit.xml
├── public
├── .htaccess
├── css
│ └── app.css
├── favicon.ico
├── fonts
│ └── vendor
│ │ └── bootstrap-sass
│ │ └── bootstrap
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.svg
│ │ ├── glyphicons-halflings-regular.ttf
│ │ ├── glyphicons-halflings-regular.woff
│ │ └── glyphicons-halflings-regular.woff2
├── img
│ └── logo.png
├── index.php
├── mix-manifest.json
├── robots.txt
├── vendor
│ └── laravel-filemanager
│ │ ├── css
│ │ ├── cropper.min.css
│ │ ├── dropzone.min.css
│ │ ├── lfm.css
│ │ └── mfb.css
│ │ ├── img
│ │ ├── folder.png
│ │ └── loader.svg
│ │ └── js
│ │ ├── cropper.min.js
│ │ ├── dropzone.min.js
│ │ ├── jquery.form.min.js
│ │ ├── lfm.js
│ │ ├── mfb.js
│ │ └── script.js
└── web.config
├── readme.md
├── resources
├── assets
│ ├── js
│ │ ├── admin-app.js
│ │ ├── app.js
│ │ └── bootstrap.js
│ └── sass
│ │ ├── _variables.scss
│ │ ├── admin.scss
│ │ ├── app.scss
│ │ ├── commerce.scss
│ │ └── login.scss
├── lang
│ └── en
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
└── views
│ ├── anasayfa.blade.php
│ ├── arama.blade.php
│ ├── errors
│ ├── 404.blade.php
│ └── 500.blade.php
│ ├── kategori.blade.php
│ ├── kullanici
│ ├── kaydol.blade.php
│ └── oturumac.blade.php
│ ├── layouts
│ ├── master.blade.php
│ └── partials
│ │ ├── alert.blade.php
│ │ ├── errors.blade.php
│ │ ├── footer.blade.php
│ │ ├── head.blade.php
│ │ └── navbar.blade.php
│ ├── mails
│ └── kullanici_kayit.blade.php
│ ├── odeme.blade.php
│ ├── sepet.blade.php
│ ├── siparis.blade.php
│ ├── siparisler.blade.php
│ ├── urun.blade.php
│ └── yonetim
│ ├── anasayfa.blade.php
│ ├── kategori
│ ├── form.blade.php
│ └── index.blade.php
│ ├── kullanici
│ ├── form.blade.php
│ └── index.blade.php
│ ├── layouts
│ ├── master.blade.php
│ └── partials
│ │ ├── navbar.blade.php
│ │ └── sidebar.blade.php
│ ├── oturumac.blade.php
│ ├── siparis
│ ├── form.blade.php
│ └── index.blade.php
│ └── urun
│ ├── form.blade.php
│ └── index.blade.php
├── routes
├── api.php
├── channels.php
├── console.php
└── web.php
├── server.php
├── storage
├── app
│ ├── .gitignore
│ └── public
│ │ └── .gitignore
├── framework
│ ├── .gitignore
│ ├── cache
│ │ └── .gitignore
│ ├── sessions
│ │ └── .gitignore
│ ├── testing
│ │ └── .gitignore
│ └── views
│ │ └── .gitignore
└── logs
│ └── .gitignore
├── tests
├── CreatesApplication.php
├── Feature
│ └── ExampleTest.php
├── TestCase.php
└── Unit
│ └── ExampleTest.php
└── webpack.mix.js
/.env.example:
--------------------------------------------------------------------------------
1 | APP_NAME=Laravel
2 | APP_ENV=local
3 | APP_KEY=
4 | APP_DEBUG=true
5 | APP_LOG_LEVEL=debug
6 | APP_URL=http://localhost
7 |
8 | DB_CONNECTION=mysql
9 | DB_HOST=127.0.0.1
10 | DB_PORT=3306
11 | DB_DATABASE=homestead
12 | DB_USERNAME=homestead
13 | DB_PASSWORD=secret
14 |
15 | BROADCAST_DRIVER=log
16 | CACHE_DRIVER=file
17 | SESSION_DRIVER=file
18 | QUEUE_DRIVER=sync
19 |
20 | REDIS_HOST=127.0.0.1
21 | REDIS_PASSWORD=null
22 | REDIS_PORT=6379
23 |
24 | MAIL_DRIVER=smtp
25 | MAIL_HOST=smtp.mailtrap.io
26 | MAIL_PORT=2525
27 | MAIL_USERNAME=null
28 | MAIL_PASSWORD=null
29 | MAIL_ENCRYPTION=null
30 |
31 | PUSHER_APP_ID=
32 | PUSHER_APP_KEY=
33 | PUSHER_APP_SECRET=
34 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 | *.css linguist-vendored
3 | *.scss linguist-vendored
4 | *.js linguist-vendored
5 | CHANGELOG.md export-ignore
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /public/css
3 | /public/js
4 | /public/uploads
5 | /public/storage
6 | /storage/*.key
7 | /vendor
8 | /.idea
9 | /.vagrant
10 | Homestead.json
11 | Homestead.yaml
12 | npm-debug.log
13 | yarn-error.log
14 | .env
15 |
--------------------------------------------------------------------------------
/app/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('inspire')
28 | // ->hourly();
29 | }
30 |
31 | /**
32 | * Register the commands for the application.
33 | *
34 | * @return void
35 | */
36 | protected function commands()
37 | {
38 | $this->load(__DIR__.'/Commands');
39 |
40 | require base_path('routes/console.php');
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/Exceptions/Handler.php:
--------------------------------------------------------------------------------
1 | view('errors.404', compact('exception'), 404);
57 | }
58 |
59 | if ($exception instanceof ModelNotFoundException)
60 | {
61 | return response()->view('errors.404', compact('exception'), 404);
62 | }
63 |
64 | return parent::render($request, $exception);
65 | }
66 |
67 | protected function unauthenticated($request, AuthenticationException $exception)
68 | {
69 | return $request->expectsJson()
70 | ? response()->json(['message' => 'Unauthenticated.'], 401)
71 | : redirect()->guest(route('kullanici.oturumac'));
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/app/Handlers/LfmConfigHandler.php:
--------------------------------------------------------------------------------
1 | user()->id;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/app/Http/Controllers/AnasayfaController.php:
--------------------------------------------------------------------------------
1 | take(8)->get();
13 |
14 | $urunler_slider = Urun::select('urun.*')
15 | ->join('urun_detay', 'urun_detay.urun_id', 'urun.id')
16 | ->where('urun_detay.goster_slider', 1)
17 | ->orderBy('guncelleme_tarihi', 'desc')
18 | ->take(config('ayar.anasayfa_slider_urun_adet'))->get();
19 |
20 | $urun_gunun_firsati = Urun::select('urun.*')
21 | ->join('urun_detay', 'urun_detay.urun_id', 'urun.id')
22 | ->where('urun_detay.goster_gunun_firsati', 1)
23 | ->orderBy('guncelleme_tarihi', 'desc')
24 | ->first();
25 |
26 | $urunler_one_cikan = Urun::select('urun.*')
27 | ->join('urun_detay', 'urun_detay.urun_id', 'urun.id')
28 | ->where('urun_detay.goster_one_cikan', 1)
29 | ->orderBy('guncelleme_tarihi', 'desc')
30 | ->take(get_ayar('anasayfa_liste_urun_adet'))->get();
31 |
32 | $urunler_cok_satan = Urun::select('urun.*')
33 | ->join('urun_detay', 'urun_detay.urun_id', 'urun.id')
34 | ->where('urun_detay.goster_cok_satan', 1)
35 | ->orderBy('guncelleme_tarihi', 'desc')
36 | ->take(get_ayar('anasayfa_liste_urun_adet'))->get();
37 |
38 | $urunler_indirimli = Urun::select('urun.*')
39 | ->join('urun_detay', 'urun_detay.urun_id', 'urun.id')
40 | ->where('urun_detay.goster_indirimli', 1)
41 | ->orderBy('guncelleme_tarihi', 'desc')
42 | ->take(get_ayar('anasayfa_liste_urun_adet'))->get();
43 |
44 | return view('anasayfa', compact('kategoriler', 'urunler_slider', 'urun_gunun_firsati', 'urunler_one_cikan', 'urunler_cok_satan', 'urunler_indirimli'));
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Controller.php:
--------------------------------------------------------------------------------
1 | firstOrFail();
12 | $alt_kategoriler = Kategori::where('ust_id', $kategori->id)->get();
13 | $ust_kategori = Kategori::find($kategori->ust_id);
14 |
15 | $order = request('order');
16 | if ($order == 'coksatanlar') {
17 |
18 | $urunler = $kategori->urunler()
19 | ->join('urun_detay', 'urun_detay.urun_id', 'urun.id')
20 | ->orderBy('urun_detay.goster_cok_satan', 'desc')
21 | ->paginate(3);
22 |
23 | } else if ($order == 'yeni') {
24 | $urunler = $kategori->urunler()
25 | ->orderByDesc('guncelleme_tarihi')
26 | ->paginate(3);
27 | } else {
28 | $urunler = $kategori->urunler()
29 | ->orderByDesc('guncelleme_tarihi')
30 | ->paginate(3);
31 | }
32 |
33 | if (request('page') > $urunler->lastPage())
34 | return redirect()->route('kategori', $kategori->slug);
35 |
36 | return view('kategori', compact('kategori', 'alt_kategoriler', 'ust_kategori', 'urunler'));
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/Http/Controllers/KullaniciController.php:
--------------------------------------------------------------------------------
1 | middleware('guest')->except('oturumukapat');
20 | }
21 |
22 | public function giris_form()
23 | {
24 | return view('kullanici.oturumac');
25 | }
26 |
27 | public function giris()
28 | {
29 | $this->validate(request(), [
30 | 'email' => 'required|email',
31 | 'sifre' => 'required'
32 | ]);
33 |
34 | $credentials = [
35 | 'email' => request('email'),
36 | 'password' => request('sifre'),
37 | 'aktif_mi' => 1
38 | ];
39 | if (auth()->attempt($credentials, request()->has('benihatirla'))) {
40 | $aktif_sepet_id = Sepet::aktif_sepet_id();
41 | if (is_null($aktif_sepet_id)) {
42 | $aktif_sepet = Sepet::create(['kullanici_id' => auth()->id()]);
43 | $aktif_sepet_id = $aktif_sepet->id;
44 | }
45 | session()->put('aktif_sepet_id', $aktif_sepet_id);
46 |
47 | if (Cart::count() > 0) {
48 | foreach (Cart::content() as $cartItem) {
49 | $sepetUrun = SepetUrun::firstOrNew(['sepet_id' => $aktif_sepet_id, 'urun_id' => $cartItem->id]);
50 | $sepetUrun->adet += $cartItem->qty;
51 | $sepetUrun->fiyati = $cartItem->price;
52 | $sepetUrun->durum = "Beklemede";
53 | $sepetUrun->save();
54 | }
55 | }
56 |
57 | Cart::destroy();
58 | $sepetUrunler = SepetUrun::with('urun')->where('sepet_id', $aktif_sepet_id)->get();
59 | foreach ($sepetUrunler as $sepetUrun) {
60 | Cart::add($sepetUrun->urun->id, $sepetUrun->urun->urun_adi, $sepetUrun->adet, $sepetUrun->fiyati, ['slug' => $sepetUrun->urun->slug]);
61 | }
62 |
63 | return redirect()->intended('/');
64 | } else {
65 | $errors = ['email' => 'Hatalı giriş'];
66 |
67 | return back()->withErrors($errors);
68 | }
69 | }
70 |
71 | public function kaydol_form()
72 | {
73 | return view('kullanici.kaydol');
74 | }
75 |
76 | public function kaydol()
77 | {
78 | $this->validate(request(), [
79 | 'adsoyad' => 'required|min:5|max:60',
80 | 'email' => 'required|email|unique:kullanici',
81 | 'sifre' => 'required|confirmed|min:5|max:15'
82 | ]);
83 |
84 | $kullanici = Kullanici::create([
85 | 'adsoyad' => request('adsoyad'),
86 | 'email' => request('email'),
87 | 'sifre' => Hash::make(request('sifre')),
88 | 'aktivasyon_anahtari' => Str::random(60),
89 | 'aktif_mi' => 0
90 | ]);
91 | $kullanici->detay()->save(new KullaniciDetay());
92 |
93 | Mail::to(request('email'))->send(new KullaniciKayitMail($kullanici));
94 |
95 | auth()->login($kullanici);
96 |
97 | return redirect()->route('anasayfa');
98 | }
99 |
100 | public function aktiflestir($anahtar)
101 | {
102 | $kullanici = Kullanici::where('aktivasyon_anahtari', $anahtar)->first();
103 | if (!is_null($kullanici)) {
104 | $kullanici->aktivasyon_anahtari = null;
105 | $kullanici->aktif_mi = 1;
106 | $kullanici->save();
107 |
108 | return redirect()->to('/')
109 | ->with('mesaj', 'Kullanıcı kaydınız aktifleştirildi')
110 | ->with('mesaj_tur', 'success');
111 | } else {
112 | return redirect()->to('/')
113 | ->with('mesaj', 'Kullanıcı kaydınız aktifleştirilemedi')
114 | ->with('mesaj_tur', 'warning');
115 | }
116 | }
117 |
118 | public function oturumukapat()
119 | {
120 | auth()->logout();
121 |
122 | return redirect()->route('anasayfa');
123 | }
124 | }
125 |
--------------------------------------------------------------------------------
/app/Http/Controllers/OdemeController.php:
--------------------------------------------------------------------------------
1 | check()) {
13 | return redirect()->route('kullanici.oturumac')
14 | ->with('mesaj_tur', 'info')
15 | ->with('mesaj', 'Ödeme işlemi için oturum açmanız veye kullanıcı kaydı yapmanız gerekmektedir.');
16 | } else if (count(Cart::content()) == 0) {
17 | return redirect()->route('anasayfa')
18 | ->with('mesaj_tur', 'info')
19 | ->with('mesaj', 'Ödeme işlemi için sepetinizde bir ürün bulunmalıdır.');
20 | }
21 |
22 | $kullanici_detay = auth()->user()->detay;
23 |
24 | return view('odeme', compact('kullanici_detay'));
25 | }
26 |
27 | public function odemeyap()
28 | {
29 | $siparis = request()->all();
30 | $siparis['sepet_id'] = session('aktif_sepet_id');
31 | $siparis['banka'] = "Garanti";
32 | $siparis['taksit_sayisi'] = 1;
33 | $siparis['durum'] = "Siparişiniz alındı";
34 | $siparis['siparis_tutari'] = Cart::subtotal();
35 |
36 | Siparis::create($siparis);
37 | Cart::destroy();
38 | session()->forget('aktif_sepet_id');
39 |
40 | return redirect()->route('siparisler')
41 | ->with('mesaj_tur', 'success')
42 | ->with('mesaj', 'Ödemeniz başarılı bir şekilde gerçekleştirildi.');
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/Http/Controllers/SepetController.php:
--------------------------------------------------------------------------------
1 | id, $urun->urun_adi, $adet, $urun->fiyati, ['slug' => $urun->slug]);
23 |
24 | if (auth()->check()) {
25 | $aktif_sepet_id = session('aktif_sepet_id');
26 | if (!isset($aktif_sepet_id)) {
27 | $aktif_sepet = Sepet::create([
28 | 'kullanici_id' => auth()->id()
29 | ]);
30 | $aktif_sepet_id = $aktif_sepet->id;
31 | session()->put('aktif_sepet_id', $aktif_sepet_id);
32 | }
33 |
34 | SepetUrun::updateOrCreate(
35 | ['sepet_id' => $aktif_sepet_id, 'urun_id' => $urun->id],
36 | ['adet' => $cartItem->qty, 'fiyati' => $urun->fiyati, 'durum' => 'Beklemede']
37 | );
38 | }
39 |
40 | return redirect()->route('sepet')
41 | ->with('mesaj_tur', 'success')
42 | ->with('mesaj', 'Ürün sepete eklendi.');
43 | }
44 |
45 | public function kaldir($rowid)
46 | {
47 | if (auth()->check()) {
48 | $aktif_sepet_id = session('aktif_sepet_id');
49 | $cartItem = Cart::get($rowid);
50 | SepetUrun::where('sepet_id', $aktif_sepet_id)->where('urun_id', $cartItem->id)->delete();
51 | }
52 |
53 | Cart::remove($rowid);
54 |
55 | return redirect()->route('sepet')
56 | ->with('mesaj_tur', 'success')
57 | ->with('mesaj', 'Ürün sepetten kaldırıldı.');
58 | }
59 |
60 | public function bosalt()
61 | {
62 | if (auth()->check()) {
63 | $aktif_sepet_id = session('aktif_sepet_id');
64 | SepetUrun::where('sepet_id', $aktif_sepet_id)->delete();
65 | }
66 |
67 | Cart::destroy();
68 |
69 | return redirect()->route('sepet')
70 | ->with('mesaj_tur', 'success')
71 | ->with('mesaj', 'Sepetiniz boşaltıldı.');
72 | }
73 |
74 | public function guncelle($rowid)
75 | {
76 | $validator = Validator::make(request()->all(), [
77 | 'adet' => 'required|numeric|between:0,5'
78 | ]);
79 |
80 | if ($validator->fails()) {
81 | session()->flash('mesaj_tur', 'danger');
82 | session()->flash('mesaj', 'Adet değeri en az 1 en fazla 5 olabilir!');
83 |
84 | return response()->json(['success' => false]);
85 | }
86 |
87 | if (auth()->check()) {
88 | $aktif_sepet_id = session('aktif_sepet_id');
89 | $cartItem = Cart::get($rowid);
90 |
91 | if (request('adet') == 0)
92 | SepetUrun::where('sepet_id', $aktif_sepet_id)->where('urun_id', $cartItem->id)
93 | ->delete();
94 | else
95 | SepetUrun::where('sepet_id', $aktif_sepet_id)->where('urun_id', $cartItem->id)
96 | ->update(['adet' => request('adet')]);
97 | }
98 |
99 | Cart::update($rowid, request('adet'));
100 |
101 | session()->flash('mesaj_tur', 'success');
102 | session()->flash('mesaj', 'Adet bilgisi güncellendi');
103 |
104 | return response()->json(['success' => true]);
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/app/Http/Controllers/SiparisController.php:
--------------------------------------------------------------------------------
1 | whereHas('sepet', function($query) {
14 | $query->where('kullanici_id', auth()->id());
15 | })
16 | ->orderByDesc('olusturma_tarihi')
17 | ->get();
18 |
19 | return view('siparisler', compact('siparisler'));
20 | }
21 |
22 | public function detay($id)
23 | {
24 | $siparis = Siparis::with('sepet.sepet_urunler.urun')
25 | ->whereHas('sepet', function($query) {
26 | $query->where('kullanici_id', auth()->id());
27 | })
28 | ->where('siparis.id', $id)
29 | ->firstOrFail();
30 |
31 | return view('siparis', compact('siparis'));
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/Http/Controllers/UrunController.php:
--------------------------------------------------------------------------------
1 | firstOrFail();
13 | $kategoriler = $urun->kategoriler()->distinct()->get();
14 | return view('urun', compact('urun', 'kategoriler'));
15 | }
16 |
17 | public function ara()
18 | {
19 | $aranan = request('aranan');
20 | $urunler = Urun::where('urun_adi', 'like', "%$aranan%")
21 | ->orWhere('aciklama', 'like', "%$aranan%")
22 | ->paginate(2);
23 | //->simplePaginate(2);
24 |
25 | request()->flash();
26 | return view('arama', compact('urunler'));
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Yonetim/AnasayfaController.php:
--------------------------------------------------------------------------------
1 | join('sepet', 'sepet.id', 'siparis.sepet_id')
25 | ->join('sepet_urun', 'sepet.id', 'sepet_urun.sepet_id')
26 | ->join('urun', 'urun.id', 'sepet_urun.urun_id')
27 | ->groupBy('urun_adi')
28 | ->orderBy(DB::raw('SUM(sepet_urun.adet)'), 'desc')
29 | ->get();*/
30 |
31 | $aylara_gore_satislar = DB::select("
32 | SELECT
33 | DATE_FORMAT(si.olusturma_tarihi, '%Y-%m') ay, sum(su.adet) adet
34 | FROM siparis si
35 | INNER JOIN sepet s on s.id = si.sepet_id
36 | INNER JOIN sepet_urun su on s.id=su.sepet_id
37 | GROUP BY DATE_FORMAT(si.olusturma_tarihi, '%Y-%m')
38 | ORDER BY DATE_FORMAT(si.olusturma_tarihi, '%Y-%m')
39 | ");
40 |
41 | return view('yonetim.anasayfa', compact('cok_satan_urunler', 'aylara_gore_satislar'));
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Yonetim/KategoriController.php:
--------------------------------------------------------------------------------
1 | filled('aranan') || request()->filled('ust_id')) {
13 | request()->flash();
14 | $aranan = request('aranan');
15 | $ust_id = request('ust_id');
16 | $list = Kategori::with('ust_kategori')
17 | ->where('kategori_adi', 'like', "%$aranan%")
18 | ->where('ust_id', $ust_id)
19 | ->orderByDesc('id')
20 | ->paginate(2)
21 | ->appends(['aranan' => $aranan, 'ust_id' => $ust_id]);
22 | } else {
23 | request()->flush();
24 | $list = Kategori::with('ust_kategori')->orderByDesc('id')->paginate(8);
25 | }
26 |
27 | $anakategoriler = Kategori::whereRaw('ust_id is null')->get();
28 |
29 | return view('yonetim.kategori.index', compact('list', 'anakategoriler'));
30 | }
31 |
32 | public function form($id = 0)
33 | {
34 | $entry = new Kategori;
35 | if ($id > 0) {
36 | $entry = Kategori::find($id);
37 | }
38 |
39 | $kategoriler = Kategori::all();
40 |
41 | return view('yonetim.kategori.form', compact('entry', 'kategoriler'));
42 | }
43 |
44 | public function kaydet($id = 0)
45 | {
46 | $data = request()->only('kategori_adi', 'slug', 'ust_id');
47 | if (!request()->filled('slug')) {
48 | $data['slug'] = str_slug(request('kategori_adi'));
49 | request()->merge(['slug' => $data['slug']]);
50 | }
51 |
52 | $this->validate(request(), [
53 | 'kategori_adi' => 'required',
54 | 'slug' => (request('original_slug') != request('slug') ? 'unique:kategori,slug' : '')
55 | ]);
56 |
57 | if ($id > 0) {
58 | $entry = Kategori::where('id', $id)->firstOrFail();
59 | $entry->update($data);
60 | } else {
61 | $entry = Kategori::create($data);
62 | }
63 |
64 | return redirect()
65 | ->route('yonetim.kategori.duzenle', $entry->id)
66 | ->with('mesaj', ($id > 0 ? 'Güncellendi' : 'Kaydedildi'))
67 | ->with('mesaj_tur', 'success');
68 | }
69 |
70 | public function sil($id)
71 | {
72 | $kategori = Kategori::find($id);
73 | $kategori_urun_adet = $kategori->urunler()->count();
74 | if ($kategori_urun_adet>0)
75 | {
76 | return redirect()
77 | ->route('yonetim.kategori')
78 | ->with('mesaj', "Bu kategoride $kategori_urun_adet adet ürün var. Bu yüzden silme işlemi yapılmamıştır.")
79 | ->with('mesaj_tur', 'warning');
80 | }
81 | $kategori->urunler()->detach();
82 | $kategori->delete();
83 |
84 | return redirect()
85 | ->route('yonetim.kategori')
86 | ->with('mesaj', 'Kayıt silindi')
87 | ->with('mesaj_tur', 'success');
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Yonetim/KullaniciController.php:
--------------------------------------------------------------------------------
1 | isMethod('POST')) {
16 | $this->validate(request(), [
17 | 'email' => 'required|email',
18 | 'sifre' => 'required'
19 | ]);
20 |
21 | $credentials = [
22 | 'email' => request()->get('email'),
23 | 'password' => request()->get('sifre'),
24 | 'yonetici_mi' => 1,
25 | 'aktif_mi' => 1
26 | ];
27 |
28 | if (Auth::guard('yonetim')->attempt($credentials, request()->has('benihatirla'))) {
29 | return redirect()->route('yonetim.anasayfa');
30 | } else {
31 | return back()->withInput()->withErrors(['email' => 'Giriş hatalı!']);
32 | }
33 | }
34 |
35 | return view('yonetim.oturumac');
36 | }
37 |
38 | public function oturumukapat()
39 | {
40 | Auth::guard('yonetim')->logout();
41 |
42 | return redirect()->route('yonetim.oturumac');
43 | }
44 |
45 | public function index()
46 | {
47 | if (request()->filled('aranan')) {
48 | request()->flash();
49 | $aranan = request('aranan');
50 | $list = Kullanici::where('adsoyad', 'like', "%$aranan%")
51 | ->orWhere('email', 'like', "%$aranan%")
52 | ->orderByDesc('olusturma_tarihi')
53 | ->paginate(8)
54 | ->appends('aranan', $aranan);
55 | } else {
56 | $list = Kullanici::orderByDesc('olusturma_tarihi')->paginate(8);
57 | }
58 |
59 | return view('yonetim.kullanici.index', compact('list'));
60 | }
61 |
62 | public function form($id = 0)
63 | {
64 | $entry = new Kullanici;
65 | if ($id > 0) {
66 | $entry = Kullanici::find($id);
67 | }
68 |
69 | return view('yonetim.kullanici.form', compact('entry'));
70 | }
71 |
72 | public function kaydet($id = 0)
73 | {
74 | $this->validate(request(), [
75 | 'adsoyad' => 'required',
76 | 'email' => 'required|email'
77 | ]);
78 |
79 | $data = request()->only('adsoyad', 'email');
80 | if (request()->filled('sifre')) {
81 | $data['sifre'] = Hash::make(request('sifre'));
82 | }
83 | $data['aktif_mi'] = request()->has('aktif_mi') && request('aktif_mi') == 1 ? 1 : 0;
84 | $data['yonetici_mi'] = request()->has('yonetici_mi') && request('yonetici_mi') == 1 ? 1 : 0;
85 |
86 | if ($id > 0) {
87 | $entry = Kullanici::where('id', $id)->firstOrFail();
88 | $entry->update($data);
89 | } else {
90 | $entry = Kullanici::create($data);
91 | }
92 |
93 | KullaniciDetay::updateOrCreate(
94 | ['kullanici_id' => $entry->id],
95 | [
96 | 'adres' => request('adres'),
97 | 'telefon' => request('telefon'),
98 | 'ceptelefonu' => request('ceptelefonu')
99 | ]
100 | );
101 |
102 | return redirect()
103 | ->route('yonetim.kullanici.duzenle', $entry->id)
104 | ->with('mesaj', ($id > 0 ? 'Güncellendi' : 'Kaydedildi'))
105 | ->with('mesaj_tur', 'success');
106 | }
107 |
108 | public function sil($id)
109 | {
110 | Kullanici::destroy($id);
111 |
112 | return redirect()
113 | ->route('yonetim.kullanici')
114 | ->with('mesaj', 'Kayıt silindi')
115 | ->with('mesaj_tur', 'success');
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Yonetim/SiparisController.php:
--------------------------------------------------------------------------------
1 | filled('aranan')) {
13 | request()->flash();
14 | $aranan = request('aranan');
15 | $list = Siparis::with('sepet.kullanici')
16 | ->where('adsoyad', 'like', "%$aranan%")
17 | ->orWhere('id', $aranan)
18 | ->orderByDesc('id')
19 | ->paginate(8)
20 | ->appends('aranan', $aranan);
21 | } else {
22 | $list = Siparis::with('sepet.kullanici')
23 | ->orderByDesc('id')
24 | ->paginate(8);
25 | }
26 |
27 | return view('yonetim.siparis.index', compact('list'));
28 | }
29 |
30 | public function form($id = 0)
31 | {
32 | if ($id > 0) {
33 | $entry = Siparis::with('sepet.sepet_urunler.urun')->find($id);
34 | }
35 |
36 | return view('yonetim.siparis.form', compact('entry'));
37 | }
38 |
39 | public function kaydet($id = 0)
40 | {
41 | $this->validate(request(), [
42 | 'adsoyad' => 'required',
43 | 'adres' => 'required',
44 | 'telefon' => 'required',
45 | 'durum' => 'required'
46 | ]);
47 |
48 | $data = request()->only('adsoyad', 'adres', 'telefon', 'ceptelefonu', 'durum');
49 |
50 | if ($id > 0) {
51 | $entry = Siparis::where('id', $id)->firstOrFail();
52 | $entry->update($data);
53 | }
54 |
55 | return redirect()
56 | ->route('yonetim.siparis.duzenle', $entry->id)
57 | ->with('mesaj', 'Güncellendi')
58 | ->with('mesaj_tur', 'success');
59 | }
60 |
61 | public function sil($id)
62 | {
63 | Siparis::destroy($id);
64 |
65 | return redirect()
66 | ->route('yonetim.siparis')
67 | ->with('mesaj', 'Kayıt silindi')
68 | ->with('mesaj_tur', 'success');
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Yonetim/UrunController.php:
--------------------------------------------------------------------------------
1 | filled('aranan')) {
16 | request()->flash();
17 | $aranan = request('aranan');
18 | $list = Urun::where('urun_adi', 'like', "%$aranan%")
19 | ->orWhere('aciklama', 'like', "%$aranan%")
20 | ->orderByDesc('id')
21 | ->paginate(8)
22 | ->appends('aranan', $aranan);
23 | } else {
24 | $list = Urun::orderByDesc('id')->paginate(8);
25 | }
26 |
27 | return view('yonetim.urun.index', compact('list'));
28 | }
29 |
30 | public function form($id = 0)
31 | {
32 | $entry = new Urun;
33 | $urun_kategorileri = [];
34 | if ($id > 0) {
35 | $entry = Urun::find($id);
36 | $urun_kategorileri = $entry->kategoriler()->pluck('kategori_id')->all();
37 | }
38 |
39 | $kategoriler = Kategori::all();
40 |
41 | return view('yonetim.urun.form', compact('entry', 'kategoriler', 'urun_kategorileri'));
42 | }
43 |
44 | public function kaydet($id = 0)
45 | {
46 | $data = request()->only('urun_adi', 'slug', 'aciklama', 'fiyati');
47 | if (!request()->filled('slug')) {
48 | $data['slug'] = str_slug(request('urun_adi'));
49 | request()->merge(['slug' => $data['slug']]);
50 | }
51 |
52 | $this->validate(request(), [
53 | 'urun_adi' => 'required',
54 | 'fiyati' => 'required',
55 | 'slug' => (request('original_slug') != request('slug') ? 'unique:urun,slug' : '')
56 | ]);
57 |
58 | $data_detay = request()->only('goster_slider', 'goster_gunun_firsati', 'goster_one_cikan', 'goster_cok_satan', 'goster_indirimli');
59 |
60 | $kategoriler = request('kategoriler');
61 |
62 | if ($id > 0) {
63 | $entry = Urun::where('id', $id)->firstOrFail();
64 | $entry->update($data);
65 | $entry->detay()->update($data_detay);
66 | $entry->kategoriler()->sync($kategoriler);
67 | } else {
68 | $entry = Urun::create($data);
69 | $entry->detay()->create($data_detay);
70 | $entry->kategoriler()->attach($kategoriler);
71 | }
72 |
73 | if (request()->hasFile('urun_resmi')) {
74 | $this->validate(request(), [
75 | 'urun_resmi' => 'image|mimes:jpg,png,jpeg,gif|max:2048'
76 | ]);
77 |
78 | $urun_resmi = request()->file('urun_resmi');
79 | //$urun_resmi = request()->urun_resmi;
80 |
81 | $dosyaadi = $entry->id . "-" . time() . "." . $urun_resmi->extension();
82 | //$dosyaadi = $urun_resmi->getClientOriginalName();
83 | //$dosyaadi = $urun_resmi->hashName();
84 |
85 | if ($urun_resmi->isValid()) {
86 | File::delete('uploads/urunler/' . $entry->detay->urun_resmi);
87 |
88 | $urun_resmi->move('uploads/urunler', $dosyaadi);
89 |
90 | UrunDetay::updateOrCreate(
91 | ['urun_id' => $entry->id],
92 | ['urun_resmi' => $dosyaadi]
93 | );
94 | }
95 | }
96 |
97 | return redirect()
98 | ->route('yonetim.urun.duzenle', $entry->id)
99 | ->with('mesaj', ($id > 0 ? 'Güncellendi' : 'Kaydedildi'))
100 | ->with('mesaj_tur', 'success');
101 | }
102 |
103 | public function sil($id)
104 | {
105 | $urun = Urun::find($id);
106 |
107 | File::delete('uploads/urunler/' . $urun->detay->urun_resmi);
108 |
109 | $urun->kategoriler()->detach();
110 | //$urun->detay()->delete();
111 |
112 | $urun->delete();
113 |
114 | return redirect()
115 | ->route('yonetim.urun')
116 | ->with('mesaj', 'Kayıt silindi')
117 | ->with('mesaj_tur', 'success');
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/app/Http/Kernel.php:
--------------------------------------------------------------------------------
1 | [
31 | \App\Http\Middleware\EncryptCookies::class,
32 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
33 | \Illuminate\Session\Middleware\StartSession::class,
34 | // \Illuminate\Session\Middleware\AuthenticateSession::class,
35 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
36 | \App\Http\Middleware\VerifyCsrfToken::class,
37 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
38 | ],
39 |
40 | 'api' => [
41 | 'throttle:60,1',
42 | 'bindings',
43 | ],
44 | ];
45 |
46 | /**
47 | * The application's route middleware.
48 | *
49 | * These middleware may be assigned to groups or used individually.
50 | *
51 | * @var array
52 | */
53 | protected $routeMiddleware = [
54 | 'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
55 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
56 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
57 | 'can' => \Illuminate\Auth\Middleware\Authorize::class,
58 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
59 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
60 | 'yonetim' => \App\Http\Middleware\Yonetim::class
61 | ];
62 | }
63 |
--------------------------------------------------------------------------------
/app/Http/Middleware/EncryptCookies.php:
--------------------------------------------------------------------------------
1 | check()) {
21 | return redirect('/');
22 | }
23 |
24 | return $next($request);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrimStrings.php:
--------------------------------------------------------------------------------
1 | check() && Auth::guard('yonetim')->user()->yonetici_mi)
20 | {
21 | return $next($request);
22 | }
23 |
24 | return redirect()->route('yonetim.oturumac');
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Mail/KullaniciKayitMail.php:
--------------------------------------------------------------------------------
1 | kullanici = $kullanici;
25 | }
26 |
27 | /**
28 | * Build the message.
29 | *
30 | * @return $this
31 | */
32 | public function build()
33 | {
34 | return $this
35 | ->subject(config('app.name') . ' - Kullanıcı Kaydı')
36 | ->view('mails.kullanici_kayit');
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/Models/Ayar.php:
--------------------------------------------------------------------------------
1 | belongsToMany('App\Models\Urun', 'kategori_urun');
22 | }
23 |
24 | public function alt_kategoriler()
25 | {
26 | return $this->hasMany('App\Models\Kategori', 'ust_id', 'id');
27 | }
28 |
29 | public function ust_kategori() {
30 | return $this->belongsTo('App\Models\Kategori', 'ust_id')->withDefault([
31 | 'kategori_adi' => 'Ana Kategori'
32 | ]);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/Models/Kullanici.php:
--------------------------------------------------------------------------------
1 | sifre;
25 | }
26 |
27 | public function detay()
28 | {
29 | return $this->hasOne('App\Models\KullaniciDetay')->withDefault();
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/Models/KullaniciDetay.php:
--------------------------------------------------------------------------------
1 | belongsTo('App\Models\Kullanici');
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/app/Models/Sepet.php:
--------------------------------------------------------------------------------
1 | hasOne('App\Models\Siparis');
24 | }
25 |
26 | public function sepet_urunler()
27 | {
28 | return $this->hasMany('App\Models\SepetUrun');
29 | }
30 |
31 | public static function aktif_sepet_id()
32 | {
33 | $aktif_sepet = DB::table('sepet as s')
34 | ->leftJoin('siparis as si', 'si.sepet_id', '=', 's.id')
35 | ->where('s.kullanici_id', auth()->id())
36 | ->whereRaw('si.id is null')
37 | ->orderByDesc('s.olusturma_tarihi')
38 | ->select('s.id')
39 | ->first();
40 |
41 | if (!is_null($aktif_sepet)) return $aktif_sepet->id;
42 | }
43 |
44 | public function sepet_urun_adet()
45 | {
46 | return DB::table('sepet_urun')
47 | ->whereRaw('silinme_tarihi is null')
48 | ->where('sepet_id', $this->id)
49 | ->sum('adet');
50 | }
51 |
52 | public function kullanici()
53 | {
54 | return $this->belongsTo('App\Models\Kullanici');
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/app/Models/SepetUrun.php:
--------------------------------------------------------------------------------
1 | belongsTo('App\Models\Urun');
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/Models/Siparis.php:
--------------------------------------------------------------------------------
1 | belongsTo('App\Models\Sepet');
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Models/Urun.php:
--------------------------------------------------------------------------------
1 | belongsToMany('App\Models\Kategori', 'kategori_urun');
23 | }
24 |
25 | public function detay()
26 | {
27 | return $this->hasOne('App\Models\UrunDetay')->withDefault();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/Models/UrunDetay.php:
--------------------------------------------------------------------------------
1 | belongsTo('App\Models\Urun');
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/Providers/AppServiceProvider.php:
--------------------------------------------------------------------------------
1 | addMinutes(10);
28 | $istatistikler = Cache::remember('istatistikler', $bitisZamani, function () {
29 | return [
30 | 'bekleyen_siparis' => Siparis::where('durum', 'Siparişiniz alındı')->count()
31 | ];
32 | });
33 | View::share('istatistikler', $istatistikler);*/
34 |
35 | View::composer(['yonetim.*'], function($view) {
36 | $bitisZamani = now()->addMinutes(10);
37 | $istatistikler = Cache::remember('istatistikler', $bitisZamani, function () {
38 | return [
39 | 'bekleyen_siparis' => Siparis::where('durum', 'Siparişiniz alındı')->count(),
40 | 'tamamlanan_siparis' => Siparis::where('durum', 'Sipariş tamamlandı')->count(),
41 | 'toplam_urun' => Urun::count(),
42 | 'toplam_kategori' => Kategori::count(),
43 | 'toplam_kullanici' => Kullanici::count()
44 | ];
45 | });
46 |
47 | $view->with('istatistikler', $istatistikler);
48 | });
49 |
50 | foreach(Ayar::all() as $ayar) {
51 | Config::set('ayar.' . $ayar->anahtar, $ayar->deger);
52 | }
53 | }
54 |
55 | /**
56 | * Register any application services.
57 | *
58 | * @return void
59 | */
60 | public function register()
61 | {
62 | //
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/app/Providers/AuthServiceProvider.php:
--------------------------------------------------------------------------------
1 | 'App\Policies\ModelPolicy',
17 | ];
18 |
19 | /**
20 | * Register any authentication / authorization services.
21 | *
22 | * @return void
23 | */
24 | public function boot()
25 | {
26 | $this->registerPolicies();
27 |
28 | //
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/Providers/BroadcastServiceProvider.php:
--------------------------------------------------------------------------------
1 | [
17 | 'App\Listeners\EventListener',
18 | ],
19 | ];
20 |
21 | /**
22 | * Register any events for your application.
23 | *
24 | * @return void
25 | */
26 | public function boot()
27 | {
28 | parent::boot();
29 |
30 | //
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | mapApiRoutes();
39 |
40 | $this->mapWebRoutes();
41 |
42 | //
43 | }
44 |
45 | /**
46 | * Define the "web" routes for the application.
47 | *
48 | * These routes all receive session state, CSRF protection, etc.
49 | *
50 | * @return void
51 | */
52 | protected function mapWebRoutes()
53 | {
54 | Route::middleware('web')
55 | ->namespace($this->namespace)
56 | ->group(base_path('routes/web.php'));
57 | }
58 |
59 | /**
60 | * Define the "api" routes for the application.
61 | *
62 | * These routes are typically stateless.
63 | *
64 | * @return void
65 | */
66 | protected function mapApiRoutes()
67 | {
68 | Route::prefix('api')
69 | ->middleware('api')
70 | ->namespace($this->namespace)
71 | ->group(base_path('routes/api.php'));
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/app/helpers.php:
--------------------------------------------------------------------------------
1 | where('anahtar', $anahtar)->first()->deger;
14 | }
15 | }
--------------------------------------------------------------------------------
/artisan:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | make(Illuminate\Contracts\Console\Kernel::class);
34 |
35 | $status = $kernel->handle(
36 | $input = new Symfony\Component\Console\Input\ArgvInput,
37 | new Symfony\Component\Console\Output\ConsoleOutput
38 | );
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Shutdown The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once Artisan has finished running, we will fire off the shutdown events
46 | | so that any final work may be done by the application before we shut
47 | | down the process. This is the last thing to happen to the request.
48 | |
49 | */
50 |
51 | $kernel->terminate($input, $status);
52 |
53 | exit($status);
54 |
--------------------------------------------------------------------------------
/bootstrap/app.php:
--------------------------------------------------------------------------------
1 | singleton(
30 | Illuminate\Contracts\Http\Kernel::class,
31 | App\Http\Kernel::class
32 | );
33 |
34 | $app->singleton(
35 | Illuminate\Contracts\Console\Kernel::class,
36 | App\Console\Kernel::class
37 | );
38 |
39 | $app->singleton(
40 | Illuminate\Contracts\Debug\ExceptionHandler::class,
41 | App\Exceptions\Handler::class
42 | );
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Return The Application
47 | |--------------------------------------------------------------------------
48 | |
49 | | This script returns the application instance. The instance is given to
50 | | the calling script so we can separate the building of the instances
51 | | from the actual running of the application and sending responses.
52 | |
53 | */
54 |
55 | return $app;
56 |
--------------------------------------------------------------------------------
/bootstrap/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "laravel/laravel",
3 | "description": "The Laravel Framework.",
4 | "keywords": ["framework", "laravel"],
5 | "license": "MIT",
6 | "type": "project",
7 | "require": {
8 | "php": ">=7.0.0",
9 | "doctrine/dbal": "^2.6",
10 | "fideloper/proxy": "~4.0",
11 | "gloudemans/shoppingcart": "^2.4",
12 | "laravel/framework": "5.6.*",
13 | "laravel/tinker": "~1.0",
14 | "unisharp/laravel-filemanager": "~1.8"
15 | },
16 | "require-dev": {
17 | "filp/whoops": "~2.0",
18 | "fzaninotto/faker": "~1.4",
19 | "mockery/mockery": "0.9.*",
20 | "phpunit/phpunit": "~7.0"
21 | },
22 | "autoload": {
23 | "files": [
24 | "app/helpers.php"
25 | ],
26 | "classmap": [
27 | "database/seeds",
28 | "database/factories"
29 | ],
30 | "psr-4": {
31 | "App\\": "app/"
32 | }
33 | },
34 | "autoload-dev": {
35 | "psr-4": {
36 | "Tests\\": "tests/"
37 | }
38 | },
39 | "extra": {
40 | "laravel": {
41 | "dont-discover": [
42 | ]
43 | }
44 | },
45 | "scripts": {
46 | "post-root-package-install": [
47 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
48 | ],
49 | "post-create-project-cmd": [
50 | "@php artisan key:generate"
51 | ],
52 | "post-autoload-dump": [
53 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
54 | "@php artisan package:discover"
55 | ]
56 | },
57 | "config": {
58 | "preferred-install": "dist",
59 | "sort-packages": true,
60 | "optimize-autoloader": true
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/config/auth.php:
--------------------------------------------------------------------------------
1 | [
17 | 'guard' => 'web',
18 | 'passwords' => 'users',
19 | ],
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Authentication Guards
24 | |--------------------------------------------------------------------------
25 | |
26 | | Next, you may define every authentication guard for your application.
27 | | Of course, a great default configuration has been defined for you
28 | | here which uses session storage and the Eloquent user provider.
29 | |
30 | | All authentication drivers have a user provider. This defines how the
31 | | users are actually retrieved out of your database or other storage
32 | | mechanisms used by this application to persist your user's data.
33 | |
34 | | Supported: "session", "token"
35 | |
36 | */
37 |
38 | 'guards' => [
39 | 'web' => [
40 | 'driver' => 'session',
41 | 'provider' => 'users',
42 | ],
43 |
44 | 'yonetim' => [
45 | 'driver' => 'session',
46 | 'provider' => 'users',
47 | ],
48 |
49 | 'api' => [
50 | 'driver' => 'token',
51 | 'provider' => 'users',
52 | ],
53 | ],
54 |
55 | /*
56 | |--------------------------------------------------------------------------
57 | | User Providers
58 | |--------------------------------------------------------------------------
59 | |
60 | | All authentication drivers have a user provider. This defines how the
61 | | users are actually retrieved out of your database or other storage
62 | | mechanisms used by this application to persist your user's data.
63 | |
64 | | If you have multiple user tables or models you may configure multiple
65 | | sources which represent each model / table. These sources may then
66 | | be assigned to any extra authentication guards you have defined.
67 | |
68 | | Supported: "database", "eloquent"
69 | |
70 | */
71 |
72 | 'providers' => [
73 | 'users' => [
74 | 'driver' => 'eloquent',
75 | 'model' => App\Models\Kullanici::class,
76 | ],
77 |
78 | // 'users' => [
79 | // 'driver' => 'database',
80 | // 'table' => 'users',
81 | // ],
82 | ],
83 |
84 | /*
85 | |--------------------------------------------------------------------------
86 | | Resetting Passwords
87 | |--------------------------------------------------------------------------
88 | |
89 | | You may specify multiple password reset configurations if you have more
90 | | than one user table or model in the application and you want to have
91 | | separate password reset settings based on the specific user types.
92 | |
93 | | The expire time is the number of minutes that the reset token should be
94 | | considered valid. This security feature keeps tokens short-lived so
95 | | they have less time to be guessed. You may change this as needed.
96 | |
97 | */
98 |
99 | 'passwords' => [
100 | 'users' => [
101 | 'provider' => 'users',
102 | 'table' => 'password_resets',
103 | 'expire' => 60,
104 | ],
105 | ],
106 |
107 | ];
108 |
--------------------------------------------------------------------------------
/config/broadcasting.php:
--------------------------------------------------------------------------------
1 | env('BROADCAST_DRIVER', 'null'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Broadcast Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the broadcast connections that will be used
26 | | to broadcast events to other systems or over websockets. Samples of
27 | | each available type of connection are provided inside this array.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'pusher' => [
34 | 'driver' => 'pusher',
35 | 'key' => env('PUSHER_APP_KEY'),
36 | 'secret' => env('PUSHER_APP_SECRET'),
37 | 'app_id' => env('PUSHER_APP_ID'),
38 | 'options' => [
39 | //
40 | ],
41 | ],
42 |
43 | 'redis' => [
44 | 'driver' => 'redis',
45 | 'connection' => 'default',
46 | ],
47 |
48 | 'log' => [
49 | 'driver' => 'log',
50 | ],
51 |
52 | 'null' => [
53 | 'driver' => 'null',
54 | ],
55 |
56 | ],
57 |
58 | ];
59 |
--------------------------------------------------------------------------------
/config/cache.php:
--------------------------------------------------------------------------------
1 | env('CACHE_DRIVER', 'file'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Cache Stores
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the cache "stores" for your application as
26 | | well as their drivers. You may even define multiple stores for the
27 | | same cache driver to group types of items stored in your caches.
28 | |
29 | */
30 |
31 | 'stores' => [
32 |
33 | 'apc' => [
34 | 'driver' => 'apc',
35 | ],
36 |
37 | 'array' => [
38 | 'driver' => 'array',
39 | ],
40 |
41 | 'database' => [
42 | 'driver' => 'database',
43 | 'table' => 'cache',
44 | 'connection' => null,
45 | ],
46 |
47 | 'file' => [
48 | 'driver' => 'file',
49 | 'path' => storage_path('framework/cache/data'),
50 | ],
51 |
52 | 'memcached' => [
53 | 'driver' => 'memcached',
54 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
55 | 'sasl' => [
56 | env('MEMCACHED_USERNAME'),
57 | env('MEMCACHED_PASSWORD'),
58 | ],
59 | 'options' => [
60 | // Memcached::OPT_CONNECT_TIMEOUT => 2000,
61 | ],
62 | 'servers' => [
63 | [
64 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
65 | 'port' => env('MEMCACHED_PORT', 11211),
66 | 'weight' => 100,
67 | ],
68 | ],
69 | ],
70 |
71 | 'redis' => [
72 | 'driver' => 'redis',
73 | 'connection' => 'default',
74 | ],
75 |
76 | ],
77 |
78 | /*
79 | |--------------------------------------------------------------------------
80 | | Cache Key Prefix
81 | |--------------------------------------------------------------------------
82 | |
83 | | When utilizing a RAM based store such as APC or Memcached, there might
84 | | be other applications utilizing the same cache. So, we'll specify a
85 | | value to get prefixed to all our keys so we can avoid collisions.
86 | |
87 | */
88 |
89 | 'prefix' => 'laravel',
90 |
91 | ];
92 |
--------------------------------------------------------------------------------
/config/cart.php:
--------------------------------------------------------------------------------
1 | 18,
16 |
17 | /*
18 | |--------------------------------------------------------------------------
19 | | Shoppingcart database settings
20 | |--------------------------------------------------------------------------
21 | |
22 | | Here you can set the connection that the shoppingcart should use when
23 | | storing and restoring a cart.
24 | |
25 | */
26 |
27 | 'database' => [
28 |
29 | 'connection' => null,
30 |
31 | 'table' => 'shoppingcart',
32 |
33 | ],
34 |
35 | /*
36 | |--------------------------------------------------------------------------
37 | | Destroy the cart on user logout
38 | |--------------------------------------------------------------------------
39 | |
40 | | When this option is set to 'true' the cart will automatically
41 | | destroy all cart instances when the user logs out.
42 | |
43 | */
44 |
45 | 'destroy_on_logout' => false,
46 |
47 | /*
48 | |--------------------------------------------------------------------------
49 | | Default number format
50 | |--------------------------------------------------------------------------
51 | |
52 | | This defaults will be used for the formated numbers if you don't
53 | | set them in the method call.
54 | |
55 | */
56 |
57 | 'format' => [
58 |
59 | 'decimals' => 2,
60 |
61 | 'decimal_point' => '.',
62 |
63 | 'thousand_seperator' => ','
64 |
65 | ],
66 |
67 | ];
--------------------------------------------------------------------------------
/config/database.php:
--------------------------------------------------------------------------------
1 | env('DB_CONNECTION', 'mysql'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Database Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here are each of the database connections setup for your application.
24 | | Of course, examples of configuring each database platform that is
25 | | supported by Laravel is shown below to make development simple.
26 | |
27 | |
28 | | All database work in Laravel is done through the PHP PDO facilities
29 | | so make sure you have the driver for your particular database of
30 | | choice installed on your machine before you begin development.
31 | |
32 | */
33 |
34 | 'connections' => [
35 |
36 | 'sqlite' => [
37 | 'driver' => 'sqlite',
38 | 'database' => env('DB_DATABASE', database_path('database.sqlite')),
39 | 'prefix' => '',
40 | ],
41 |
42 | 'mysql' => [
43 | 'driver' => 'mysql',
44 | 'host' => env('DB_HOST', '127.0.0.1'),
45 | 'port' => env('DB_PORT', '3306'),
46 | 'database' => env('DB_DATABASE', 'forge'),
47 | 'username' => env('DB_USERNAME', 'forge'),
48 | 'password' => env('DB_PASSWORD', ''),
49 | 'unix_socket' => env('DB_SOCKET', ''),
50 | 'charset' => 'utf8mb4',
51 | 'collation' => 'utf8mb4_unicode_ci',
52 | 'prefix' => '',
53 | 'strict' => true,
54 | 'engine' => null,
55 | ],
56 |
57 | 'pgsql' => [
58 | 'driver' => 'pgsql',
59 | 'host' => env('DB_HOST', '127.0.0.1'),
60 | 'port' => env('DB_PORT', '5432'),
61 | 'database' => env('DB_DATABASE', 'forge'),
62 | 'username' => env('DB_USERNAME', 'forge'),
63 | 'password' => env('DB_PASSWORD', ''),
64 | 'charset' => 'utf8',
65 | 'prefix' => '',
66 | 'schema' => 'public',
67 | 'sslmode' => 'prefer',
68 | ],
69 |
70 | 'sqlsrv' => [
71 | 'driver' => 'sqlsrv',
72 | 'host' => env('DB_HOST', 'localhost'),
73 | 'port' => env('DB_PORT', '1433'),
74 | 'database' => env('DB_DATABASE', 'forge'),
75 | 'username' => env('DB_USERNAME', 'forge'),
76 | 'password' => env('DB_PASSWORD', ''),
77 | 'charset' => 'utf8',
78 | 'prefix' => '',
79 | ],
80 |
81 | ],
82 |
83 | /*
84 | |--------------------------------------------------------------------------
85 | | Migration Repository Table
86 | |--------------------------------------------------------------------------
87 | |
88 | | This table keeps track of all the migrations that have already run for
89 | | your application. Using this information, we can determine which of
90 | | the migrations on disk haven't actually been run in the database.
91 | |
92 | */
93 |
94 | 'migrations' => 'migrations',
95 |
96 | /*
97 | |--------------------------------------------------------------------------
98 | | Redis Databases
99 | |--------------------------------------------------------------------------
100 | |
101 | | Redis is an open source, fast, and advanced key-value store that also
102 | | provides a richer set of commands than a typical key-value systems
103 | | such as APC or Memcached. Laravel makes it easy to dig right in.
104 | |
105 | */
106 |
107 | 'redis' => [
108 |
109 | 'client' => 'predis',
110 |
111 | 'default' => [
112 | 'host' => env('REDIS_HOST', '127.0.0.1'),
113 | 'password' => env('REDIS_PASSWORD', null),
114 | 'port' => env('REDIS_PORT', 6379),
115 | 'database' => 0,
116 | ],
117 |
118 | ],
119 |
120 | ];
121 |
--------------------------------------------------------------------------------
/config/filesystems.php:
--------------------------------------------------------------------------------
1 | env('FILESYSTEM_DRIVER', 'local'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Default Cloud Filesystem Disk
21 | |--------------------------------------------------------------------------
22 | |
23 | | Many applications store files both locally and in the cloud. For this
24 | | reason, you may specify a default "cloud" driver here. This driver
25 | | will be bound as the Cloud disk implementation in the container.
26 | |
27 | */
28 |
29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'),
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Filesystem Disks
34 | |--------------------------------------------------------------------------
35 | |
36 | | Here you may configure as many filesystem "disks" as you wish, and you
37 | | may even configure multiple disks of the same driver. Defaults have
38 | | been setup for each driver as an example of the required options.
39 | |
40 | | Supported Drivers: "local", "ftp", "s3", "rackspace"
41 | |
42 | */
43 |
44 | 'disks' => [
45 |
46 | 'local' => [
47 | 'driver' => 'local',
48 | 'root' => storage_path('app'),
49 | ],
50 |
51 | 'public' => [
52 | 'driver' => 'local',
53 | 'root' => storage_path('app/public'),
54 | 'url' => env('APP_URL').'/storage',
55 | 'visibility' => 'public',
56 | ],
57 |
58 | 's3' => [
59 | 'driver' => 's3',
60 | 'key' => env('AWS_KEY'),
61 | 'secret' => env('AWS_SECRET'),
62 | 'region' => env('AWS_REGION'),
63 | 'bucket' => env('AWS_BUCKET'),
64 | ],
65 |
66 | ],
67 |
68 | ];
69 |
--------------------------------------------------------------------------------
/config/hashing.php:
--------------------------------------------------------------------------------
1 | 'bcrypt',
18 | ];
19 |
--------------------------------------------------------------------------------
/config/logging.php:
--------------------------------------------------------------------------------
1 | env('LOG_CHANNEL', 'stack'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Log Channels
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure the log channels for your application. Out of
24 | | the box, Laravel uses the Monolog PHP logging library. This gives
25 | | you a variety of powerful log handlers / formatters to utilize.
26 | |
27 | | Available Drivers: "single", "daily", "slack", "syslog",
28 | | "errorlog", "custom", "stack"
29 | |
30 | */
31 |
32 | 'channels' => [
33 | 'stack' => [
34 | 'driver' => 'stack',
35 | 'channels' => ['single'],
36 | ],
37 |
38 | 'single' => [
39 | 'driver' => 'single',
40 | 'path' => storage_path('logs/laravel.log'),
41 | 'level' => 'debug',
42 | ],
43 |
44 | 'daily' => [
45 | 'driver' => 'daily',
46 | 'path' => storage_path('logs/laravel.log'),
47 | 'level' => 'debug',
48 | 'days' => 7,
49 | ],
50 |
51 | 'slack' => [
52 | 'driver' => 'slack',
53 | 'url' => env('LOG_SLACK_WEBHOOK_URL'),
54 | 'username' => 'Laravel Log',
55 | 'emoji' => ':boom:',
56 | 'level' => 'critical',
57 | ],
58 |
59 | 'syslog' => [
60 | 'driver' => 'syslog',
61 | 'level' => 'debug',
62 | ],
63 |
64 | 'errorlog' => [
65 | 'driver' => 'errorlog',
66 | 'level' => 'debug',
67 | ],
68 | ],
69 |
70 | ];
71 |
--------------------------------------------------------------------------------
/config/mail.php:
--------------------------------------------------------------------------------
1 | env('MAIL_DRIVER', 'smtp'),
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | SMTP Host Address
24 | |--------------------------------------------------------------------------
25 | |
26 | | Here you may provide the host address of the SMTP server used by your
27 | | applications. A default option is provided that is compatible with
28 | | the Mailgun mail service which will provide reliable deliveries.
29 | |
30 | */
31 |
32 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
33 |
34 | /*
35 | |--------------------------------------------------------------------------
36 | | SMTP Host Port
37 | |--------------------------------------------------------------------------
38 | |
39 | | This is the SMTP port used by your application to deliver e-mails to
40 | | users of the application. Like the host we have set this value to
41 | | stay compatible with the Mailgun e-mail application by default.
42 | |
43 | */
44 |
45 | 'port' => env('MAIL_PORT', 587),
46 |
47 | /*
48 | |--------------------------------------------------------------------------
49 | | Global "From" Address
50 | |--------------------------------------------------------------------------
51 | |
52 | | You may wish for all e-mails sent by your application to be sent from
53 | | the same address. Here, you may specify a name and address that is
54 | | used globally for all e-mails that are sent by your application.
55 | |
56 | */
57 |
58 | 'from' => [
59 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
60 | 'name' => env('MAIL_FROM_NAME', 'Example'),
61 | ],
62 |
63 | /*
64 | |--------------------------------------------------------------------------
65 | | E-Mail Encryption Protocol
66 | |--------------------------------------------------------------------------
67 | |
68 | | Here you may specify the encryption protocol that should be used when
69 | | the application send e-mail messages. A sensible default using the
70 | | transport layer security protocol should provide great security.
71 | |
72 | */
73 |
74 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
75 |
76 | /*
77 | |--------------------------------------------------------------------------
78 | | SMTP Server Username
79 | |--------------------------------------------------------------------------
80 | |
81 | | If your SMTP server requires a username for authentication, you should
82 | | set it here. This will get used to authenticate with your server on
83 | | connection. You may also set the "password" value below this one.
84 | |
85 | */
86 |
87 | 'username' => env('MAIL_USERNAME'),
88 |
89 | 'password' => env('MAIL_PASSWORD'),
90 |
91 | /*
92 | |--------------------------------------------------------------------------
93 | | Sendmail System Path
94 | |--------------------------------------------------------------------------
95 | |
96 | | When using the "sendmail" driver to send e-mails, we will need to know
97 | | the path to where Sendmail lives on this server. A default path has
98 | | been provided here, which will work well on most of your systems.
99 | |
100 | */
101 |
102 | 'sendmail' => '/usr/sbin/sendmail -bs',
103 |
104 | /*
105 | |--------------------------------------------------------------------------
106 | | Markdown Mail Settings
107 | |--------------------------------------------------------------------------
108 | |
109 | | If you are using Markdown based email rendering, you may configure your
110 | | theme and component paths here, allowing you to customize the design
111 | | of the emails. Or, you may simply stick with the Laravel defaults!
112 | |
113 | */
114 |
115 | 'markdown' => [
116 | 'theme' => 'default',
117 |
118 | 'paths' => [
119 | resource_path('views/vendor/mail'),
120 | ],
121 | ],
122 |
123 | ];
124 |
--------------------------------------------------------------------------------
/config/queue.php:
--------------------------------------------------------------------------------
1 | env('QUEUE_DRIVER', 'sync'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Queue Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may configure the connection information for each server that
26 | | is used by your application. A default configuration has been added
27 | | for each back-end shipped with Laravel. You are free to add more.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'sync' => [
34 | 'driver' => 'sync',
35 | ],
36 |
37 | 'database' => [
38 | 'driver' => 'database',
39 | 'table' => 'jobs',
40 | 'queue' => 'default',
41 | 'retry_after' => 90,
42 | ],
43 |
44 | 'beanstalkd' => [
45 | 'driver' => 'beanstalkd',
46 | 'host' => 'localhost',
47 | 'queue' => 'default',
48 | 'retry_after' => 90,
49 | ],
50 |
51 | 'sqs' => [
52 | 'driver' => 'sqs',
53 | 'key' => 'your-public-key',
54 | 'secret' => 'your-secret-key',
55 | 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id',
56 | 'queue' => 'your-queue-name',
57 | 'region' => 'us-east-1',
58 | ],
59 |
60 | 'redis' => [
61 | 'driver' => 'redis',
62 | 'connection' => 'default',
63 | 'queue' => 'default',
64 | 'retry_after' => 90,
65 | ],
66 |
67 | ],
68 |
69 | /*
70 | |--------------------------------------------------------------------------
71 | | Failed Queue Jobs
72 | |--------------------------------------------------------------------------
73 | |
74 | | These options configure the behavior of failed queue job logging so you
75 | | can control which database and table are used to store the jobs that
76 | | have failed. You may change them to any database / table you wish.
77 | |
78 | */
79 |
80 | 'failed' => [
81 | 'database' => env('DB_CONNECTION', 'mysql'),
82 | 'table' => 'failed_jobs',
83 | ],
84 |
85 | ];
86 |
--------------------------------------------------------------------------------
/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => env('MAILGUN_DOMAIN'),
19 | 'secret' => env('MAILGUN_SECRET'),
20 | ],
21 |
22 | 'ses' => [
23 | 'key' => env('SES_KEY'),
24 | 'secret' => env('SES_SECRET'),
25 | 'region' => 'us-east-1',
26 | ],
27 |
28 | 'sparkpost' => [
29 | 'secret' => env('SPARKPOST_SECRET'),
30 | ],
31 |
32 | 'stripe' => [
33 | 'model' => App\Models\Kullanici::class,
34 | 'key' => env('STRIPE_KEY'),
35 | 'secret' => env('STRIPE_SECRET'),
36 | ],
37 |
38 | ];
39 |
--------------------------------------------------------------------------------
/config/view.php:
--------------------------------------------------------------------------------
1 | [
17 | resource_path('views'),
18 | ],
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Compiled View Path
23 | |--------------------------------------------------------------------------
24 | |
25 | | This option determines where all the compiled Blade templates will be
26 | | stored for your application. Typically, this is within the storage
27 | | directory. However, as usual, you are free to change this value.
28 | |
29 | */
30 |
31 | 'compiled' => realpath(storage_path('framework/views')),
32 |
33 | ];
34 |
--------------------------------------------------------------------------------
/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite
2 |
--------------------------------------------------------------------------------
/database/factories/UserFactory.php:
--------------------------------------------------------------------------------
1 | define(App\Models\Kullanici::class, function (Faker $faker) {
17 | static $password;
18 |
19 | return [
20 | 'name' => $faker->name,
21 | 'email' => $faker->unique()->safeEmail,
22 | 'password' => $password ?: $password = bcrypt('secret'),
23 | 'remember_token' => str_random(10),
24 | ];
25 | });
26 |
--------------------------------------------------------------------------------
/database/migrations/2017_10_17_183408_create_kategori_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->integer('ust_id')->nullable();
19 | $table->string('kategori_adi', 30);
20 | $table->string('slug', 40);
21 | $table->timestamp('olusturma_tarihi')->default(DB::raw('CURRENT_TIMESTAMP'));
22 | $table->timestamp('guncelleme_tarihi')->default(DB::raw('CURRENT_TIMESTAMP on UPDATE CURRENT_TIMESTAMP'));
23 | //$table->softDeletes();
24 | $table->timestamp('silinme_tarihi')->nullable();
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | *
31 | * @return void
32 | */
33 | public function down()
34 | {
35 | Schema::dropIfExists('kategori');
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/database/migrations/2017_10_29_114953_create_urun_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('slug', 160);
19 | $table->string('urun_adi', 150);
20 | $table->text('aciklama')->nullable();
21 | $table->decimal('fiyati', 10, 3);
22 | $table->timestamp('olusturma_tarihi')->default(DB::raw('CURRENT_TIMESTAMP'));
23 | $table->timestamp('guncelleme_tarihi')->default(DB::raw('CURRENT_TIMESTAMP on UPDATE CURRENT_TIMESTAMP'));
24 | $table->timestamp('silinme_tarihi')->nullable();
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | *
31 | * @return void
32 | */
33 | public function down()
34 | {
35 | Schema::dropIfExists('urun');
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/database/migrations/2017_11_02_170735_create_kategori_urun_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->integer('kategori_id')->unsigned();
19 | $table->integer('urun_id')->unsigned();
20 |
21 | $table->foreign('kategori_id')->references('id')->on('kategori')->onDelete('cascade');
22 | $table->foreign('urun_id')->references('id')->on('urun')->onDelete('cascade');
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | *
29 | * @return void
30 | */
31 | public function down()
32 | {
33 | Schema::dropIfExists('kategori_urun');
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/database/migrations/2017_11_05_101237_create_urun_detay_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->integer('urun_id')->unsigned()->unique();
19 | $table->boolean('goster_slider')->default(0);
20 | $table->boolean('goster_gunun_firsati')->default(0);
21 | $table->boolean('goster_one_cikan')->default(0);
22 | $table->boolean('goster_cok_satan')->default(0);
23 | $table->boolean('goster_indirimli')->default(0);
24 | $table->string('urun_resmi', 50);
25 |
26 | //$table->unique('urun_id');
27 |
28 | $table->foreign('urun_id')->references('id')->on('urun')->onDelete('cascade');
29 | });
30 | }
31 |
32 | /**
33 | * Reverse the migrations.
34 | *
35 | * @return void
36 | */
37 | public function down()
38 | {
39 | Schema::dropIfExists('urun_detay');
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/database/migrations/2017_11_10_191439_create_kullanici_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('adsoyad', 60);
19 | $table->string('email', 150)->unique();
20 | $table->string('sifre', 60);
21 | $table->string('aktivasyon_anahtari', 60)->nullable();
22 | $table->boolean('aktif_mi')->default(0);
23 | $table->boolean('yonetici_mi')->default(0);
24 | $table->rememberToken();
25 |
26 | $table->timestamp('olusturma_tarihi')->default(DB::raw('CURRENT_TIMESTAMP'));
27 | $table->timestamp('guncelleme_tarihi')->default(DB::raw('CURRENT_TIMESTAMP on UPDATE CURRENT_TIMESTAMP'));
28 | $table->timestamp('silinme_tarihi')->nullable();
29 | });
30 | }
31 |
32 | /**
33 | * Reverse the migrations.
34 | *
35 | * @return void
36 | */
37 | public function down()
38 | {
39 | Schema::dropIfExists('kullanici');
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/database/migrations/2017_11_17_200454_create_sepet_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->integer('kullanici_id')->unsigned();
19 |
20 | $table->timestamp('olusturma_tarihi')->default(DB::raw('CURRENT_TIMESTAMP'));
21 | $table->timestamp('guncelleme_tarihi')->default(DB::raw('CURRENT_TIMESTAMP on UPDATE CURRENT_TIMESTAMP'));
22 | $table->timestamp('silinme_tarihi')->nullable();
23 |
24 | $table->foreign('kullanici_id')->references('id')->on('kullanici')->onDelete('cascade');
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | *
31 | * @return void
32 | */
33 | public function down()
34 | {
35 | Schema::dropIfExists('sepet');
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/database/migrations/2017_11_19_184606_create_sepet_urun_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->integer('sepet_id')->unsigned();
19 | $table->integer('urun_id')->unsigned();
20 | $table->integer('adet');
21 | $table->decimal('fiyati', 5, 2);
22 | $table->string('durum', 30);
23 |
24 | $table->timestamp('olusturma_tarihi')->default(DB::raw('CURRENT_TIMESTAMP'));
25 | $table->timestamp('guncelleme_tarihi')->default(DB::raw('CURRENT_TIMESTAMP on UPDATE CURRENT_TIMESTAMP'));
26 | $table->timestamp('silinme_tarihi')->nullable();
27 |
28 | $table->foreign('sepet_id')->references('id')->on('sepet')->onDelete('cascade');
29 | $table->foreign('urun_id')->references('id')->on('urun')->onDelete('cascade');
30 | });
31 | }
32 |
33 | /**
34 | * Reverse the migrations.
35 | *
36 | * @return void
37 | */
38 | public function down()
39 | {
40 | Schema::dropIfExists('sepet_urun');
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/database/migrations/2017_11_26_131901_create_siparis_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->integer('sepet_id')->unsigned();
19 | $table->decimal('siparis_tutari', 10, 4);
20 | $table->string('durum', 30)->nullable();
21 |
22 | $table->string('adsoyad', 50)->nullable();
23 | $table->string('adres', 200)->nullable();
24 | $table->string('telefon', 15)->nullable();
25 | $table->string('ceptelefonu', 15)->nullable();
26 | $table->string('banka', 20)->nullable();
27 | $table->integer('taksit_sayisi')->nullable();
28 |
29 | $table->timestamp('olusturma_tarihi')->default(DB::raw('CURRENT_TIMESTAMP'));
30 | $table->timestamp('guncelleme_tarihi')->default(DB::raw('CURRENT_TIMESTAMP on UPDATE CURRENT_TIMESTAMP'));
31 | $table->timestamp('silinme_tarihi')->nullable();
32 |
33 | $table->unique('sepet_id');
34 | $table->foreign('sepet_id')->references('id')->on('sepet')->onDelete('cascade');
35 | });
36 | }
37 |
38 | /**
39 | * Reverse the migrations.
40 | *
41 | * @return void
42 | */
43 | public function down()
44 | {
45 | Schema::dropIfExists('siparis');
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/database/migrations/2017_11_26_133711_create_kullanici_detay_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->integer('kullanici_id')->unsigned();
19 | $table->string('adres', 200)->nullable();
20 | $table->string('telefon', 15)->nullable();
21 | $table->string('ceptelefonu', 15)->nullable();
22 |
23 | $table->foreign('kullanici_id')->references('id')->on('kullanici')->onDelete('cascade');
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('kullanici_detay');
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/database/migrations/2018_06_19_194441_create_ayar_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('anahtar');
19 | $table->text('deger')->nullable();
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | *
26 | * @return void
27 | */
28 | public function down()
29 | {
30 | Schema::dropIfExists('ayar');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/database/seeds/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | call(KategoriTableSeeder::class);
15 | $this->call(UrunTableSeeder::class);
16 | $this->call(KullaniciTableSeeder::class);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/database/seeds/KategoriTableSeeder.php:
--------------------------------------------------------------------------------
1 | truncate();
16 |
17 | $id = DB::table('kategori')->insertGetId(['kategori_adi'=>'Elektronik', 'slug'=>'elektronik']);
18 | DB::table('kategori')->insert(['kategori_adi'=>'Bilgisayar/Tablet', 'slug'=>'bilgisayar-tablet', 'ust_id'=>$id]);
19 | DB::table("kategori")->insert(['kategori_adi' => 'Telefon', 'slug' => 'telefon', 'ust_id'=> $id]);
20 | DB::table("kategori")->insert(['kategori_adi' => 'TV ve Ses Sistemleri', 'slug' => 'tv-ses-sistemleri', 'ust_id'=> $id]);
21 | DB::table("kategori")->insert(['kategori_adi' => 'Kamera', 'slug' => 'kamera', 'ust_id'=> $id]);
22 |
23 | $id = DB::table("kategori")->insertGetId(['kategori_adi' => 'Kitap', 'slug' => 'kitap']);
24 | DB::table("kategori")->insert(['kategori_adi' => 'Edebiyat', 'slug' => 'edebiyat', 'ust_id' => $id]);
25 | DB::table("kategori")->insert(['kategori_adi' => 'Çocuk', 'slug' => 'cocuk', 'ust_id' => $id]);
26 | DB::table("kategori")->insert(['kategori_adi' => 'Bilgisayar', 'slug' => 'bilgisayar', 'ust_id' => $id]);
27 | DB::table("kategori")->insert(['kategori_adi' => 'Sınavlara Hazırlık', 'slug' => 'sinavlara-hazirlik', 'ust_id' => $id]);
28 |
29 | DB::table("kategori")->insert(['kategori_adi' => 'Dergi', 'slug' => 'dergi']);
30 | DB::table("kategori")->insert(['kategori_adi' => 'Mobilya', 'slug' => 'mobilya']);
31 | DB::table("kategori")->insert(['kategori_adi' => 'Dekorasyon', 'slug' => 'dekorasyon']);
32 | DB::table("kategori")->insert(['kategori_adi' => 'Kozmetik', 'slug' => 'kozmetik']);
33 | DB::table("kategori")->insert(['kategori_adi' => 'Kişisel Bakım', 'slug' => 'kisisel-bakim']);
34 | DB::table("kategori")->insert(['kategori_adi' => 'Giyim ve Moda', 'slug' => 'giyim-moda']);
35 | DB::table("kategori")->insert(['kategori_adi' => 'Anne ve Çocuk', 'slug' => 'anne-cocuk']);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/database/seeds/KullaniciTableSeeder.php:
--------------------------------------------------------------------------------
1 | 'Cem Gündüzoğlu',
23 | 'email' => 'cem@eticaret.test',
24 | 'sifre' => bcrypt('123456'),
25 | 'aktif_mi' => 1,
26 | 'yonetici_mi' => 1
27 | ]);
28 | $kullanici_yonetici->detay()->create([
29 | 'adres' => 'Ankara',
30 | 'telefon' => '(312) 444 55 66',
31 | 'ceptelefonu' => '(555) 444 55 66'
32 | ]);
33 |
34 | for ($i = 0; $i < 50; $i++) {
35 | $kullanici_musteri = Kullanici::create([
36 | 'adsoyad' => $faker->name,
37 | 'email' => $faker->unique()->safeEmail,
38 | 'sifre' => bcrypt('123456'),
39 | 'aktif_mi' => 1,
40 | 'yonetici_mi' => 0
41 | ]);
42 |
43 | $kullanici_musteri->detay()->create([
44 | 'adres' => $faker->address,
45 | 'telefon' => $faker->e164PhoneNumber,
46 | 'ceptelefonu' => $faker->e164PhoneNumber
47 | ]);
48 | }
49 |
50 | DB::statement('SET FOREIGN_KEY_CHECKS=1;');
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/database/seeds/UrunTableSeeder.php:
--------------------------------------------------------------------------------
1 | streetName;
23 | $urun = Urun::create([
24 | 'urun_adi' => $urun_adi,
25 | 'slug' => str_slug($urun_adi),
26 | 'aciklama' => $faker->paragraph(20),
27 | 'fiyati' => $faker->randomFloat(3, 1, 20)
28 | ]);
29 |
30 | $detay = $urun->detay()->create([
31 | 'goster_slider'=>rand(0,1),
32 | 'goster_gunun_firsati'=>rand(0,1),
33 | 'goster_one_cikan'=>rand(0,1),
34 | 'goster_cok_satan'=>rand(0,1),
35 | 'goster_indirimli'=>rand(0,1)
36 | ]);
37 | }
38 |
39 | DB::table('kategori_urun')->truncate();
40 | $kategoriler = Kategori::all();
41 | foreach ($kategoriler as $kategori) {
42 | $urunler = Urun::pluck('id')->random(10)->all();
43 | $kategori->urunler()->attach($urunler);
44 | }
45 |
46 | DB::statement('SET FOREIGN_KEY_CHECKS=1;');
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "dev": "npm run development",
5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
6 | "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
7 | "watch-poll": "npm run watch -- --watch-poll",
8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
9 | "prod": "npm run production",
10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
11 | },
12 | "devDependencies": {
13 | "axios": "^0.16.2",
14 | "bootstrap-sass": "^3.3.7",
15 | "cross-env": "^5.0.1",
16 | "jquery": "^3.1.1",
17 | "laravel-mix": "^1.0",
18 | "lodash": "^4.17.4"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
{{ round($urun->fiyati, 2) }} ₺
51 | 52 |Merhaba {{ $kullanici->adsoyad }}, kaydınız başarılı bir şekilde yapıldı.
3 |Kaydınızı aktifleştirmek için tıklayın veya aşağıdaki bağlantıyı tarayıcınızda açın.
4 |{{ config('app.url') }}/kullanici/aktiflestir/{{ $kullanici->aktivasyon_anahtari }}
-------------------------------------------------------------------------------- /resources/views/sepet.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.master') 2 | @section('title', 'Sepet') 3 | @section('content') 4 |Ürün | 13 |Adet Fiyatı | 14 |Adet | 15 |Tutar | 16 ||
---|---|---|---|---|
20 |
21 | |
24 | 25 | 26 | {{ $urunCartItem->name }} 27 | 28 | 33 | | 34 |{{ $urunCartItem->price }} ₺ | 35 |36 | - 37 | {{ $urunCartItem->qty }} 38 | + 39 | | 40 |41 | {{ $urunCartItem->subtotal }} ₺ 42 | | 43 |
Alt Toplam | 47 |{{ Cart::subtotal() }} ₺ | 48 ||||
KDV | 51 |{{ Cart::tax() }} ₺ | 52 ||||
Genel Toplam | 55 |{{ Cart::total() }} ₺ | 56 |
Sepetinizde ürün yok!
67 | @endif 68 |Ürün | 13 |Tutar | 14 |Adet | 15 |Ara Toplam | 16 |Durum | 17 ||
---|---|---|---|---|---|
21 |
22 | |
25 | 26 | 27 | {{ $sepet_urun->urun->urun_adi }} 28 | 29 | | 30 |{{ $sepet_urun->fiyati }} ₺ | 31 |{{ $sepet_urun->adet }} | 32 |{{ $sepet_urun->fiyati * $sepet_urun->adet }} ₺ | 33 |{{ $sepet_urun->durum }} | 34 |
Toplam Tutar | 38 |{{ $siparis->siparis_tutari }} ₺ | 39 |||||
Toplam Tutar (KDV'li) | 42 |{{ $siparis->siparis_tutari* ((100+config('cart.tax'))/100) }} ₺ | 43 |||||
Sipariş Durumu | 46 |{{ $siparis->durum }} | 47 |
Henüz siparişiniz yok
9 | @else 10 |Sipariş Kodu | 13 |Tutar | 14 |Toplam Ürün | 15 |Durum | 16 |17 | |
---|---|---|---|---|
SP-{{ $siparis->id }} | 21 |{{ $siparis->siparis_tutari * ((100+config('cart.tax'))/100) }} | 22 |{{ $siparis->sepet->sepet_urun_adet() }} | 23 |{{ $siparis->durum }} | 24 |Detay | 25 |
# | 36 |Üst Kategori | 37 |Slug | 38 |Kategori Adı | 39 |Kayıt Tarihi | 40 |41 | |
---|---|---|---|---|---|
Kayıt bulunamadı! | |||||
{{ $entry->id }} | 50 |{{ $entry->ust_kategori->kategori_adi }} | 51 |{{ $entry->slug }} | 52 |{{ $entry->kategori_adi }} | 53 |{{ $entry->olusturma_tarihi }} | 54 |55 | 56 | 57 | 58 | 59 | 60 | 61 | | 62 |
# | 29 |Ad Soyad | 30 |Aktif Mi | 32 |Kullanıcı Tipi | 33 |Kayıt Tarihi | 34 |35 | | |
---|---|---|---|---|---|---|
Kayıt bulunamadı! | ||||||
{{ $entry->id }} | 44 |{{ $entry->adsoyad }} | 45 |{{ $entry->email }} | 46 |47 | @if ($entry->aktif_mi) 48 | Aktif 49 | @else 50 | Pasif 51 | @endif 52 | | 53 |54 | @if ($entry->yonetici_mi) 55 | Yönetici 56 | @else 57 | Müşteri 58 | @endif 59 | | 60 |{{ $entry->olusturma_tarihi }} | 61 |62 | 63 | 64 | 65 | 66 | 67 | 68 | | 69 |
Sipariş Kodu | 26 |Müşteri | 27 |Tutar | 28 |Durum | 29 |Sipariş Tarihi | 30 |31 | | |
---|---|---|---|---|---|---|
Kayıt bulunamadı! | 37 |||||||
SP-{{ $entry->id }} | 42 |{{ $entry->sepet->kullanici->adsoyad }} | 43 |{{ $entry->siparis_tutari * ((100 + config('cart.tax')) / 100) }} ₺ | 44 |{{ $entry->durum }} | 45 |{{ $entry->olusturma_tarihi }} | 46 |47 | 48 | 49 | 50 | 51 | 52 | 53 | | 54 |
# | 29 |Resim | 30 |Slug | 31 |Ürün Adı | 32 |Fiyatı | 33 |Kayıt Tarihi | 34 |35 | |
---|---|---|---|---|---|---|
Kayıt bulunamadı! | ||||||
{{ $entry->id }} | 44 |
45 | |
47 | {{ $entry->slug }} | 48 |{{ $entry->urun_adi }} | 49 |{{ round($entry->fiyati, 2) }} ₺ | 50 |{{ $entry->olusturma_tarihi }} | 51 |52 | 53 | 54 | 55 | 56 | 57 | 58 | | 59 |