You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.1 KiB
50 lines
1.1 KiB
2 years ago
|
<?php
|
||
|
|
||
|
namespace App\Http\Controllers\Admin;
|
||
|
|
||
|
use App\Http\Controllers\Controller;
|
||
|
use App\Models\Subscription;
|
||
|
use Illuminate\Http\Request;
|
||
|
use App\Models\User;
|
||
|
use Illuminate\Support\Facades\Session;
|
||
|
|
||
|
class SubscriptionController extends Controller
|
||
|
{
|
||
|
protected $view='admin.subscription.';
|
||
|
protected $redirect='admin/subscriptions';
|
||
|
|
||
|
public function index(){
|
||
|
$subscriptions=Subscription::paginate(config('custom.per_page'));
|
||
|
return view($this->view.'index',compact('subscriptions'));
|
||
|
}
|
||
|
|
||
|
public function show($id){
|
||
|
|
||
|
$subscription = new Subscription();
|
||
|
$subscription = $subscription->findorfail($id);
|
||
|
return view($this->view . 'show', compact('subscription'));
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
public function delete($id){
|
||
|
$setting=Placement::findorfail($id);
|
||
|
if($setting->delete()){
|
||
|
if (is_file(public_path().'/'.$setting->image) && file_exists(public_path().'/'.$setting->image)){
|
||
|
unlink(public_path().'/'.$setting->image);
|
||
|
}
|
||
|
}
|
||
|
Session::flash('success','Placement is deleted !');
|
||
|
return redirect($this->redirect);
|
||
|
|
||
|
}
|
||
|
//
|
||
|
}
|