<?php

namespace App\Http\Controllers\admin;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\subscribe;
use LaravelLocalization;
use App\Traits\allTraits;


class subscribeController extends Controller
{
    use allTraits;


    public function allSubscribes() {

        $subscribes =  subscribe::All();
        return view('admin.allSubscribes', compact('subscribes'));
    }


    public function deleteSubscribe($subscribes_id)
    {

        $subscribes = subscribe::find($subscribes_id);

        if (!$subscribes)
            return redirect()->back()->with(['error' => __('messages.news not exist')]);

        $subscribes->delete();

        return redirect()
            ->route('subscribe')
            ->with(['successDelete' => __('messages.news deleted successfully')]);

    }



}
