<?php

namespace App\Http\Controllers\Dashboard;

use App\Http\Controllers\Controller;
use App\Http\Requests\Dashboard\ProjectRequest;
use App\Models\Category;
use App\Models\ManufacturingCompany;
use App\Models\EmploymentApplication;
use App\Models\Project;
use App\Models\ServiceOrder;
use App\Models\User;
use Illuminate\Http\Request;

class AdminEmploymentApplicationController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        //
        $employment_applications = EmploymentApplication::all();
        return view('admin.employment-applications.index', compact('employment_applications'));
    }

    public function destroy($id)
    {
        //
        $customer = EmploymentApplication::findOrFail($id);

        $customer->delete();

        return response()->json();
    }
    // bluckDelete
    public function bluckDelete(Request $request)
    {

        $customers = EmploymentApplication::findOrFail($request->ids);

        foreach ($customers as $customer) {
            $customer->delete();
        } // end foeach

        session()->flash('delete_customer_msg', awtTrans('تم الحذف بنجاح'));
        return redirect()->back();
    }
}
