Skip to content

Commit

Permalink
update migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
thaerfayyad committed Mar 8, 2021
1 parent 2da18d2 commit a0e2743
Show file tree
Hide file tree
Showing 17 changed files with 549 additions and 211 deletions.
8 changes: 4 additions & 4 deletions app/Http/Controllers/admin/ContactController.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace App\Http\Controllers\admin;

use App\Http\Controllers\Controller;
use App\Models\Contact;

use App\Models\admin\Contact;
use App\xx;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;
Expand All @@ -18,7 +18,7 @@ class ContactController extends Controller
public function index()
{

$items = xx::all();
$items = Contact::all();
return view('admin.contactus.home',
[
'items' =>$items,
Expand Down Expand Up @@ -49,7 +49,7 @@ public function store(Request $request)
'email' => 'required|email',
'message' => 'required',
]);
$cont = new xx();
$cont = new Contact();
$cont->name = $request->name;
$cont->email = $request->email ;
$cont->message = $request->message ;
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/admin/bookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Http\Controllers\admin;

use App\Http\Controllers\Controller;
use App\Models\admin\Book;
use App\Models\Book;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Storage;
Expand Down Expand Up @@ -47,7 +47,7 @@ public function store(Request $request)
'name' => 'required',
'details' => 'required',
'author' => 'required',
'yearFrom' => 'required',
'year' => 'required',
'semester' => 'required',
'bookFile' => 'mimes:doc,pdf,docx,zip'
]);
Expand Down
10 changes: 10 additions & 0 deletions app/Models/Comment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Comment extends Model
{
//
}
10 changes: 10 additions & 0 deletions app/Models/Post.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Post extends Model
{
//
}
6 changes: 3 additions & 3 deletions app/Models/Book.php → app/Models/admin/Book.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Models;
namespace App\Models\admin;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
Expand All @@ -12,9 +12,9 @@ class Book extends Model
protected $guarded = [];
protected $hidden = ['created_at',' updated_at','deleted_at'];
public function getSemester(){
return $this -> semester== 1 ? 'semester"1" ' : 'semester "2" ';
return $this -> semester == 1 ? 'semester"1" ' : 'semester "2" ';
}
public function getLibrary(){
return $this -> semester== 1 ? 'General ' : 'Student ';
return $this -> library == 1 ? 'General ' : 'Student ';
}
}
6 changes: 1 addition & 5 deletions app/Models/Contact.php → app/Models/admin/Contact.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Models;
namespace App\Models\admin;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
Expand All @@ -11,8 +11,4 @@ class Contact extends Model
protected $table = 'contacts';
protected $fillable = ['name','email','message'];
protected $hidden = ['created_at',' updated_at','deleted_at'];
public function scopeSelection($query){

return $query -> select('id','name','email','message');
}
}
15 changes: 0 additions & 15 deletions app/Models/admin/Exam.php

This file was deleted.

15 changes: 0 additions & 15 deletions app/Models/admin/Library.php

This file was deleted.

26 changes: 0 additions & 26 deletions app/Models/admin/Product.php

This file was deleted.

23 changes: 0 additions & 23 deletions app/Models/admin/Vendors.php

This file was deleted.

10 changes: 0 additions & 10 deletions app/xx.php

This file was deleted.

Loading

0 comments on commit a0e2743

Please sign in to comment.