Skip to content

Commit

Permalink
Portfolio Changed
Browse files Browse the repository at this point in the history
  • Loading branch information
devboyarif committed Oct 21, 2020
1 parent 0931b13 commit 0787474
Show file tree
Hide file tree
Showing 23 changed files with 433 additions and 143 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/CareerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CareerController extends Controller
*/
public function index()
{
$career_list = Career::SimplePaginate(10);
$career_list = Career::latest()->SimplePaginate(10);
$career_list_count = Career::all()->count();
return view('admin.career.index',compact('career_list','career_list_count'));
}
Expand Down
12 changes: 0 additions & 12 deletions app/Http/Controllers/FrontendController.php

This file was deleted.

79 changes: 79 additions & 0 deletions app/Http/Controllers/PortfolioCategoryController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\PortfolioCategory;

class PortfolioCategoryController extends Controller
{





function index(){
$portfolio_category = PortfolioCategory::latest()->SimplePaginate(10);
return view('admin.portfolio.category.index',compact('portfolio_category'));
}

function create(Request $request){

$request->validate([
'p_category_name' => 'required',
],[
'p_category_name.required' => 'Portfolio category field is required.',
]);

PortfolioCategory::create([
'p_category_name' => $request->p_category_name,
]);

session()->flash('success', 'Portfolio Category Added Successfully!');
return redirect()->route('portfolio.category.index');

}

function inactive($id){
$p_category = PortfolioCategory::findOrFail($id);

if ($p_category) {
$p_category->update([
'status' => 2
]);
session()->flash('warning', 'Portfolio Category Inactive Successfully!');
return redirect()->route('portfolio.category.index');
}

}

function active($id){
$p_category = PortfolioCategory::findOrFail($id);

if ($p_category) {
$p_category->update([ 'status' => 1 ]);
session()->flash('success', 'Portfolio Category Active Successfully!');
return redirect()->route('portfolio.category.index');
}
}

function destroy($id){
$p_category = PortfolioCategory::findOrFail($id);

if ($p_category) {
$p_category->delete();
session()->flash('danger', 'Portfolio Category Deleted Successfully!');
return redirect()->route('portfolio.category.index');
}
}










}
5 changes: 5 additions & 0 deletions app/Http/Controllers/PortfolioController.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public function store(Request $request)
'tool_used' => 'required',
'client_name' => 'required',
'client_email' => 'required',
'work_type' => 'required',
'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:10048',
],[
'title.required' => 'Title field is required!',
Expand All @@ -62,6 +63,7 @@ public function store(Request $request)
'tool_used.required' => 'Tool used field is required!',
'client_name.required' => 'Client name field is required!',
'client_email.required' => 'Client email field is required!',
'work_type.required' => 'Work type field is required!',
'image.required' => 'Image field is required!',
]);

Expand All @@ -77,6 +79,7 @@ public function store(Request $request)
'tool_used' => $request->tool_used,
'client_name' => $request->client_email,
'client_email' => $request->client_email,
'work_type' => $request->work_type,
'created_at' => Carbon::now(),
]);

Expand Down Expand Up @@ -177,6 +180,7 @@ public function update(Request $request,$id)
'tool_used' => $request->tool_used,
'client_name' => $request->client_email,
'client_email' => $request->client_email,
'work_type' => $request->work_type,
'updated_at' => Carbon::now()
]);

Expand All @@ -197,6 +201,7 @@ public function update(Request $request,$id)
'tool_used' => $request->tool_used,
'client_name' => $request->client_email,
'client_email' => $request->client_email,
'work_type' => $request->work_type,
'created_at' => Carbon::now()
]);

Expand Down
8 changes: 6 additions & 2 deletions app/Http/Controllers/WebsiteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\Career;
use App\Models\Portfolio;

class WebsiteController extends Controller
{
Expand All @@ -15,11 +17,13 @@ function about(){
}

function work(){
return view('frontend.Pages.work');
$portfolio = Portfolio::latest()->get();
return view('frontend.Pages.work',compact('portfolio'));
}

function career(){
return view('frontend.Pages.career');
$career = Career::get();
return view('frontend.Pages.career',compact('career'));
}

function contact(){
Expand Down
1 change: 1 addition & 0 deletions app/Models/Career.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ class Career extends Model
'title',
'content',
];

}
1 change: 1 addition & 0 deletions app/Models/Portfolio.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ class Portfolio extends Model
'tool_used',
'client_name',
'client_email',
'work_type',
];
}
15 changes: 15 additions & 0 deletions app/Models/PortfolioCategory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class PortfolioCategory extends Model
{
use HasFactory;
protected $fillable=[
'p_category_name',
'status',
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function up()
$table->text('tool_used');
$table->string('client_name');
$table->string('client_email');
$table->integer('work_type');
$table->timestamps();
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePortfolioCategoriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('portfolio_categories', function (Blueprint $table) {
$table->id();
$table->string('p_category_name');
$table->tinyInteger('status')->default(1);
$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('portfolio_categories');
}
}
8 changes: 6 additions & 2 deletions public/frontend/assets/css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions resources/views/admin/career/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Portfolio - ZakirSoft
@endsection

@section('portfolio')
@section('career')
active pcoded-trigger
@endsection

Expand All @@ -23,7 +23,7 @@
<div class="page-header-title">
<i class="feather icon-clipboard bg-c-blue"></i>
<div class="d-inline">
<h5>Add Career</h5>
<h5>Edit Career</h5>
</div>
</div>
</div>
Expand Down Expand Up @@ -78,7 +78,7 @@
</div>


<button type="submit" class="btn btn-primary btn-round m-b-0"><i class="fas fa-sync"></i> Update Career</button>
<button type="submit" class="btn btn-primary m-b-0"><i class="fas fa-sync"></i> Update Career</button>
</form>
</div>
</div>
Expand Down
Loading

0 comments on commit 0787474

Please sign in to comment.