Commit b2e43c83 authored by Kittisak Maneewong's avatar Kittisak Maneewong

add show

parent 9526419d
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class JobController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class JobController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
return response()->json(['job' => $request->all()]);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
<?php
namespace App\Http\Controllers;
use App\Job;
use Illuminate\Http\Request;
class JobController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
return response()->json(['job' => $request->all()]);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
<?php
namespace App\Http\Controllers;
use App\Job;
use Illuminate\Http\Request;
class JobController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$job = new Job();
$job->job_title = $request->get('job_title');
$job->job_type = $request->get('job_type');
$job->department = $request->get('department');
$job->salary = $request->get('salary');
$job->branch = $request->get('branch');
$job->day = $request->get('day');
$job->time = $request->get('time');
$job->gender = $request->get('gender');
$job->num = $request->get('num');
$job->degree = $request->get('degree');
$job->gpax = $request->get('gpax');
$job->phase = $request->get('phase');
$job->feature = $request->get('feature');
$job->role = $request->get('role');
$job->welfare = $request->get('welfare');
$job->company_id = $request->get('id');
$job->save()
return response()->json(['job' => $request->all()]);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
<?php
namespace App\Http\Controllers;
use App\Job;
use Illuminate\Http\Request;
class JobController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$job = new Job();
$job->job_title = $request->get('job_title');
$job->job_type = $request->get('job_type');
$job->department = $request->get('department');
$job->salary = $request->get('salary');
$job->branch = $request->get('branch');
$job->day = $request->get('day');
$job->time = $request->get('time');
$job->gender = $request->get('gender');
$job->num = $request->get('num');
$job->degree = $request->get('degree');
$job->gpax = $request->get('gpax');
$job->phase = $request->get('phase');
$job->feature = $request->get('feature');
$job->role = $request->get('role');
$job->welfare = $request->get('welfare');
$job->company_id = $request->get('id');
$job->save();
return response()->json(['job' => $request->all()]);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
<?php
namespace App\Http\Controllers;
use App\Job;
use Illuminate\Http\Request;
class JobController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
// $job = new Job();
// $job->job_title = $request->get('job_title');
// $job->job_type = $request->get('job_type');
// $job->department = $request->get('department');
// $job->salary = $request->get('salary');
// $job->branch = $request->get('branch');
// $job->day = $request->get('day');
// $job->time = $request->get('time');
// $job->gender = $request->get('gender');
// $job->num = $request->get('num');
// $job->degree = $request->get('degree');
// $job->gpax = $request->get('gpax');
// $job->phase = $request->get('phase');
// $job->feature = $request->get('feature');
// $job->role = $request->get('role');
// $job->welfare = $request->get('welfare');
// $job->company_id = $request->get('id');
// $job->save();
return response()->json(['job' => $request->all()]);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
<?php
namespace App\Http\Controllers;
use App\Job;
use Illuminate\Http\Request;
class JobController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$gender = null
if ($request->get('gender')) {
$gender = implode(' ,', $request->get('gender'));
}
return response()->json(['gender' => $gender]);
// $job = new Job();
// $job->job_title = $request->get('job_title');
// $job->job_type = $request->get('job_type');
// $job->department = $request->get('department');
// $job->salary = $request->get('salary');
// $job->branch = $request->get('branch');
// $job->day = $request->get('day');
// $job->time = $request->get('time');
// $job->gender = $request->get('gender');
// $job->num = $request->get('num');
// $job->degree = $request->get('degree');
// $job->gpax = $request->get('gpax');
// $job->phase = $request->get('phase');
// $job->feature = $request->get('feature');
// $job->role = $request->get('role');
// $job->welfare = $request->get('welfare');
// $job->company_id = $request->get('id');
// $job->save();
return response()->json(['job' => $request->all()]);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
<?php
namespace App\Http\Controllers;
use App\Job;
use Illuminate\Http\Request;
class JobController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$gender = null
if($request->get('gender')) {
$gender = implode(' ,', $request->get('gender'));
}
return response()->json(['gender' => $gender]);
// $job = new Job();
// $job->job_title = $request->get('job_title');
// $job->job_type = $request->get('job_type');
// $job->department = $request->get('department');
// $job->salary = $request->get('salary');
// $job->branch = $request->get('branch');
// $job->day = $request->get('day');
// $job->time = $request->get('time');
// $job->gender = $request->get('gender');
// $job->num = $request->get('num');
// $job->degree = $request->get('degree');
// $job->gpax = $request->get('gpax');
// $job->phase = $request->get('phase');
// $job->feature = $request->get('feature');
// $job->role = $request->get('role');
// $job->welfare = $request->get('welfare');
// $job->company_id = $request->get('id');
// $job->save();
return response()->json(['job' => $request->all()]);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
<?php
namespace App\Http\Controllers;
use App\Job;
use Illuminate\Http\Request;
class JobController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$gender = null
if($request->get('gender')) {
$gender = implode(' ,', $request->get('gender'));
}
return response()->json(['gender' => $gender]);
// $job = new Job();
// $job->job_title = $request->get('job_title');
// $job->job_type = $request->get('job_type');
// $job->department = $request->get('department');
// $job->salary = $request->get('salary');
// $job->branch = $request->get('branch');
// $job->day = $request->get('day');
// $job->time = $request->get('time');
// $job->gender = $request->get('gender');
// $job->num = $request->get('num');
// $job->degree = $request->get('degree');
// $job->gpax = $request->get('gpax');
// $job->phase = $request->get('phase');
// $job->feature = $request->get('feature');
// $job->role = $request->get('role');
// $job->welfare = $request->get('welfare');
// $job->company_id = $request->get('id');
// $job->save();
return response()->json(['job' => $request->all()]);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
<?php
namespace App\Http\Controllers;
use App\Job;
use Illuminate\Http\Request;
class JobController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$gender = null;
if($request->get('gender')) {
$gender = implode(' ,', $request->get('gender'));
}
return response()->json(['gender' => $gender]);
// $job = new Job();
// $job->job_title = $request->get('job_title');
// $job->job_type = $request->get('job_type');
// $job->department = $request->get('department');
// $job->salary = $request->get('salary');
// $job->branch = $request->get('branch');
// $job->day = $request->get('day');
// $job->time = $request->get('time');
// $job->gender = $request->get('gender');
// $job->num = $request->get('num');
// $job->degree = $request->get('degree');
// $job->gpax = $request->get('gpax');
// $job->phase = $request->get('phase');
// $job->feature = $request->get('feature');
// $job->role = $request->get('role');
// $job->welfare = $request->get('welfare');
// $job->company_id = $request->get('id');
// $job->save();
return response()->json(['job' => $request->all()]);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
<?php
namespace App\Http\Controllers;
use App\Job;
use Illuminate\Http\Request;
class JobController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$gender = null;
if($request->get('gender')) {
$gender = implode(', ', $request->get('gender'));
}
return response()->json(['gender' => $gender]);
// $job = new Job();
// $job->job_title = $request->get('job_title');
// $job->job_type = $request->get('job_type');
// $job->department = $request->get('department');
// $job->salary = $request->get('salary');
// $job->branch = $request->get('branch');
// $job->day = $request->get('day');
// $job->time = $request->get('time');
// $job->gender = $request->get('gender');
// $job->num = $request->get('num');
// $job->degree = $request->get('degree');
// $job->gpax = $request->get('gpax');
// $job->phase = $request->get('phase');
// $job->feature = $request->get('feature');
// $job->role = $request->get('role');
// $job->welfare = $request->get('welfare');
// $job->company_id = $request->get('id');
// $job->save();
return response()->json(['job' => $request->all()]);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
<?php
namespace App\Http\Controllers;
use App\Job;
use Illuminate\Http\Request;
class JobController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$gender = null;
if($request->get('gender')) {
$gender = implode(', ', $request->get('gender'));
}
$job = new Job();
$job->job_title = $request->get('job_title');
$job->job_type = $request->get('job_type');
$job->department = $request->get('department');
$job->salary = $request->get('salary');
$job->branch = $request->get('branch');
$job->day = $request->get('day');
$job->time = $request->get('time');
$job->gender = $request->get('gender');
$job->num = $request->get('num');
$job->degree = $request->get('degree');
$job->gpax = $request->get('gpax');
$job->phase = $request->get('phase');
$job->feature = $request->get('feature');
$job->role = $request->get('role');
$job->welfare = $request->get('welfare');
$job->company_id = $request->get('id');
$job->save();
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
<?php
namespace App\Http\Controllers;
use App\Job;
use Illuminate\Http\Request;
class JobController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$gender = null;
if($request->get('gender')) {
$gender = implode(', ', $request->get('gender'));
}
$job = new Job();
$job->job_title = $request->get('job_title');
$job->job_type = $request->get('job_type');
$job->department = $request->get('department');
$job->salary = $request->get('salary');
$job->branch = $request->get('branch');
$job->day = $request->get('day');
$job->time = $request->get('time');
$job->gender = $gender;
$job->num = $request->get('num');
$job->degree = $request->get('degree');
$job->gpax = $request->get('gpax');
$job->phase = $request->get('phase');
$job->feature = $request->get('feature');
$job->role = $request->get('role');
$job->welfare = $request->get('welfare');
$job->company_id = $request->get('id');
$job->save();
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
<?php
namespace App\Http\Controllers;
use App\Job;
use Illuminate\Http\Request;
class JobController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$gender = null;
if($request->get('gender')) {
$gender = implode(', ', $request->get('gender'));
}
$job = new Job();
$job->job_title = $request->get('job_title');
$job->job_type = $request->get('job_type');
$job->department = $request->get('department');
$job->salary = $request->get('salary');
$job->branch = $request->get('branch');
$job->day = $request->get('day');
$job->time = $request->get('time');
$job->gender = $gender;
$job->num = $request->get('num');
$job->degree = $request->get('degree');
$job->gpax = $request->get('gpax');
$job->phase = $request->get('phase');
$job->feature = $request->get('feature');
$job->role = $request->get('role');
$job->welfare = $request->get('welfare');
$job->user_id = $request->get('id');
$job->save();
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
<?php
namespace App\Http\Controllers;
use App\Job;
use Illuminate\Http\Request;
class JobController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$gender = null;
if($request->get('gender')) {
$gender = implode(', ', $request->get('gender'));
}
$job = new Job();
$job->job_title = $request->get('job_title');
$job->job_type = $request->get('job_type');
$job->department = $request->get('department');
$job->salary = $request->get('salary');
$job->branch = $request->get('branch');
$job->day = $request->get('day');
$job->time = $request->get('time');
$job->gender = $gender;
$job->num = $request->get('num');
$job->degree = $request->get('degree');
$job->gpax = $request->get('gpax');
$job->phase = $request->get('phase');
$job->feature = $request->get('feature');
$job->role = $request->get('role');
$job->welfare = $request->get('welfare');
$job->user_id = $request->get('id');
$job->save();
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
$job = Job::where('user_id', $id)->get();
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
<?php
namespace App\Http\Controllers;
use App\Job;
use Illuminate\Http\Request;
class JobController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$gender = null;
if($request->get('gender')) {
$gender = implode(', ', $request->get('gender'));
}
$job = new Job();
$job->job_title = $request->get('job_title');
$job->job_type = $request->get('job_type');
$job->department = $request->get('department');
$job->salary = $request->get('salary');
$job->branch = $request->get('branch');
$job->day = $request->get('day');
$job->time = $request->get('time');
$job->gender = $gender;
$job->num = $request->get('num');
$job->degree = $request->get('degree');
$job->gpax = $request->get('gpax');
$job->phase = $request->get('phase');
$job->feature = $request->get('feature');
$job->role = $request->get('role');
$job->welfare = $request->get('welfare');
$job->user_id = $request->get('id');
$job->save();
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
$job = Job::where('user_id', $id)->get();
return response()->json(['jobs' => $job]);
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department_job');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->string('salary');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary');
$table->string('branch');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary');
$table->string('branch');
$table->string('branch');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary');
$table->string('branch');
$table->string('day');
$table->string('time');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary');
$table->string('branch');
$table->string('day');
$table->string('time');
$table->integer('num');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary');
$table->string('branch');
$table->string('day');
$table->string('time');
$table->integer('num');
$table->string('gender');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary');
$table->string('branch');
$table->string('day');
$table->string('time');
$table->integer('num');
$table->string('gender');
$table->string('degree');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary');
$table->string('branch');
$table->string('day');
$table->string('time');
$table->integer('num');
$table->string('gender');
$table->string('degree');
$table->string('gpax');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary');
$table->string('branch');
$table->string('day');
$table->string('time');
$table->integer('num');
$table->string('gender');
$table->string('degree');
$table->string('gpax');
$table->string('phase');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary');
$table->string('branch');
$table->string('day');
$table->string('time');
$table->integer('num');
$table->string('gender');
$table->string('degree');
$table->string('gpax');
$table->string('phase');
$table->text('feature');
$table->text('roles');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary');
$table->string('branch');
$table->string('day');
$table->string('time');
$table->integer('num');
$table->string('gender');
$table->string('degree');
$table->string('gpax');
$table->string('phase');
$table->text('feature');
$table->text('role');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary');
$table->string('branch');
$table->string('day');
$table->string('time');
$table->integer('num');
$table->string('gender');
$table->string('degree');
$table->string('gpax');
$table->string('phase');
$table->text('feature');
$table->text('role');
$table->text('');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary');
$table->string('branch');
$table->string('day');
$table->string('time');
$table->integer('num');
$table->string('gender');
$table->string('degree');
$table->string('gpax');
$table->string('phase');
$table->text('feature');
$table->text('role');
$table->text('welfare');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary');
$table->string('branch');
$table->string('day');
$table->string('time');
$table->integer('num');
$table->string('gender');
$table->string('degree');
$table->string('gpax');
$table->string('phase');
$table->text('feature');
$table->text('role');
$table->text('welfare');
$table->unsignedBigInteger('company_id');
$table->foreign('user_id')->references('id')->on('users');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary');
$table->string('branch');
$table->string('day');
$table->string('time');
$table->integer('num');
$table->string('gender');
$table->string('degree');
$table->string('gpax');
$table->string('phase');
$table->text('feature');
$table->text('role');
$table->text('welfare');
$table->unsignedBigInteger('company_id');
$table->foreign('company_id')->references('id')->on('companies');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use App\Job;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary');
$table->string('branch');
$table->string('day');
$table->string('time');
$table->integer('num');
$table->string('gender');
$table->string('degree');
$table->string('gpax');
$table->string('phase');
$table->text('feature');
$table->text('role');
$table->text('welfare');
$table->unsignedBigInteger('company_id');
$table->foreign('company_id')->references('id')->on('companies');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary');
$table->string('branch');
$table->string('day');
$table->string('time');
$table->integer('num');
$table->string('gender');
$table->string('degree');
$table->string('gpax');
$table->string('phase');
$table->text('feature');
$table->text('role');
$table->text('welfare');
$table->unsignedBigInteger('company_id');
$table->foreign('company_id')->references('id')->on('companies');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary');
$table->string('branch');
$table->string('day');
$table->string('time');
$table->integer('num');
$table->string('gender');
$table->string('degree');
$table->string('gpax');
$table->string('phase');
$table->text('feature');
$table->text('role');
$table->text('welfare');
$table->unsignedBigInteger('user_id');
$table->foreign('user_id')->references('id')->on('users');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('job_title');
$table->string('job_type');
$table->string('department');
$table->integer('salary')->nullable();
$table->string('branch')->nullable();
$table->string('day')->nullable();
$table->string('time')->nullable();
$table->integer('num')->nullable();
$table->string('gender')->nullable();
$table->string('degree')->nullable();
$table->string('gpax')->nullable();
$table->string('phase')->nullable();
$table->text('feature')->nullable();
$table->text('role')->nullable();
$table->text('welfare')->nullable();
$table->unsignedBigInteger('user_id');
$table->foreign('user_id')->references('id')->on('users');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}
<template>
<div>
<Toolbar page="app"></Toolbar>
<v-content>
<v-container fluid>
<v-layout>
<v-flex xs12 sm10 offset-sm1>
<v-card flat height="600px">
<router-view></router-view>
</v-card>
</v-flex>
</v-layout>
</v-container>
</v-content>
<Footer></Footer>
<Snackbar></Snackbar>
</div>
</template>
<script>
import Toolbar from '../components/Toolbar.vue';
import Footer from '../components/Footer.vue';
import Snackbar from '../components/Snackbar.vue';
export default {
components: {
Toolbar,
Footer,
Snackbar
},
beforeMount () {
this.$store.dispatch('checkUser')
}
}
</script>
<template>
<div>
<Toolbar page="app"></Toolbar>
<v-content>
<v-container fluid>
<v-layout>
<v-flex xs12 sm10 offset-sm1>
<v-card flat transparent height="600px">
<router-view></router-view>
</v-card>
</v-flex>
</v-layout>
</v-container>
</v-content>
<Footer></Footer>
<Snackbar></Snackbar>
</div>
</template>
<script>
import Toolbar from '../components/Toolbar.vue';
import Footer from '../components/Footer.vue';
import Snackbar from '../components/Snackbar.vue';
export default {
components: {
Toolbar,
Footer,
Snackbar
},
beforeMount () {
this.$store.dispatch('checkUser')
}
}
</script>
<template>
<div>
<Toolbar page="app"></Toolbar>
<v-content>
<v-container fluid>
<v-layout>
<v-flex xs12 sm10 offset-sm1>
<v-card flat class="transparent" height="600px">
<router-view></router-view>
</v-card>
</v-flex>
</v-layout>
</v-container>
</v-content>
<Footer></Footer>
<Snackbar></Snackbar>
</div>
</template>
<script>
import Toolbar from '../components/Toolbar.vue';
import Footer from '../components/Footer.vue';
import Snackbar from '../components/Snackbar.vue';
export default {
components: {
Toolbar,
Footer,
Snackbar
},
beforeMount () {
this.$store.dispatch('checkUser')
}
}
</script>
<template>
<div>
<Toolbar page="app"></Toolbar>
<v-content>
<v-container fluid class="mt-0">
<v-layout>
<v-flex xs12 sm10 offset-sm1>
<v-card flat class="transparent" height="600px">
<router-view></router-view>
</v-card>
</v-flex>
</v-layout>
</v-container>
</v-content>
<Footer></Footer>
<Snackbar></Snackbar>
</div>
</template>
<script>
import Toolbar from '../components/Toolbar.vue';
import Footer from '../components/Footer.vue';
import Snackbar from '../components/Snackbar.vue';
export default {
components: {
Toolbar,
Footer,
Snackbar
},
beforeMount () {
this.$store.dispatch('checkUser')
}
}
</script>
<template>
<div>
<Toolbar page="app"></Toolbar>
<v-content>
<v-container fluid >
<v-layout>
<v-flex xs12 sm10 offset-sm1 class="mt-0">
<v-card flat class="transparent" height="600px">
<router-view></router-view>
</v-card>
</v-flex>
</v-layout>
</v-container>
</v-content>
<Footer></Footer>
<Snackbar></Snackbar>
</div>
</template>
<script>
import Toolbar from '../components/Toolbar.vue';
import Footer from '../components/Footer.vue';
import Snackbar from '../components/Snackbar.vue';
export default {
components: {
Toolbar,
Footer,
Snackbar
},
beforeMount () {
this.$store.dispatch('checkUser')
}
}
</script>
<template>
<div>
<Toolbar page="app"></Toolbar>
<v-content>
<v-container fluid >
<v-layout>
<v-flex xs12 sm10 offset-sm1 >
<v-card flat class="transparent" height="600px">
<router-view></router-view>
</v-card>
</v-flex>
</v-layout>
</v-container>
</v-content>
<Footer></Footer>
<Snackbar></Snackbar>
</div>
</template>
<script>
import Toolbar from '../components/Toolbar.vue';
import Footer from '../components/Footer.vue';
import Snackbar from '../components/Snackbar.vue';
export default {
components: {
Toolbar,
Footer,
Snackbar
},
beforeMount () {
this.$store.dispatch('checkUser')
}
}
</script>
<template>
<div>
<Toolbar page="app"></Toolbar>
<v-content>
<v-container fluid >
<v-layout>
<v-flex xs12 sm10 offset-sm1 >
<v-card flat class="transparent mt-0" height="600px">
<router-view></router-view>
</v-card>
</v-flex>
</v-layout>
</v-container>
</v-content>
<Footer></Footer>
<Snackbar></Snackbar>
</div>
</template>
<script>
import Toolbar from '../components/Toolbar.vue';
import Footer from '../components/Footer.vue';
import Snackbar from '../components/Snackbar.vue';
export default {
components: {
Toolbar,
Footer,
Snackbar
},
beforeMount () {
this.$store.dispatch('checkUser')
}
}
</script>
<template>
<div>
<Toolbar page="app"></Toolbar>
<v-content>
<v-container fluid >
<v-layout>
<v-flex xs12 sm10 offset-sm1 >
<v-card flat class="transparent" height="600px">
<router-view></router-view>
</v-card>
</v-flex>
</v-layout>
</v-container>
</v-content>
<Footer></Footer>
<Snackbar></Snackbar>
</div>
</template>
<script>
import Toolbar from '../components/Toolbar.vue';
import Footer from '../components/Footer.vue';
import Snackbar from '../components/Snackbar.vue';
export default {
components: {
Toolbar,
Footer,
Snackbar
},
beforeMount () {
this.$store.dispatch('checkUser')
}
}
</script>
<template>
<div>
<Toolbar page="app"></Toolbar>
<v-content>
<v-container fluid >
<v-layout>
<v-flex xs12 sm10 offset-sm1 class="mt-0">
<v-card flat class="transparent" height="600px">
<router-view></router-view>
</v-card>
</v-flex>
</v-layout>
</v-container>
</v-content>
<Footer></Footer>
<Snackbar></Snackbar>
</div>
</template>
<script>
import Toolbar from '../components/Toolbar.vue';
import Footer from '../components/Footer.vue';
import Snackbar from '../components/Snackbar.vue';
export default {
components: {
Toolbar,
Footer,
Snackbar
},
beforeMount () {
this.$store.dispatch('checkUser')
}
}
</script>
<template>
<div>
<Toolbar page="app"></Toolbar>
<v-content>
<v-container fluid >
<v-layout>
<v-flex xs12 sm10 offset-sm1 class="pt-0">
<v-card flat class="transparent" height="600px">
<router-view></router-view>
</v-card>
</v-flex>
</v-layout>
</v-container>
</v-content>
<Footer></Footer>
<Snackbar></Snackbar>
</div>
</template>
<script>
import Toolbar from '../components/Toolbar.vue';
import Footer from '../components/Footer.vue';
import Snackbar from '../components/Snackbar.vue';
export default {
components: {
Toolbar,
Footer,
Snackbar
},
beforeMount () {
this.$store.dispatch('checkUser')
}
}
</script>
<template>
<div>
<Toolbar page="app"></Toolbar>
<v-content>
<v-container fluid >
<v-layout>
<v-flex xs12 sm10 offset-sm1 >
<v-card flat class="transparent" height="600px">
<router-view></router-view>
</v-card>
</v-flex>
</v-layout>
</v-container>
</v-content>
<Footer></Footer>
<Snackbar></Snackbar>
</div>
</template>
<script>
import Toolbar from '../components/Toolbar.vue';
import Footer from '../components/Footer.vue';
import Snackbar from '../components/Snackbar.vue';
export default {
components: {
Toolbar,
Footer,
Snackbar
},
beforeMount () {
this.$store.dispatch('checkUser')
}
}
</script>
import Vue from 'vue';
import VueRouter from 'vue-router';
import iView from 'iview';
Vue.use(VueRouter);
import AppLayout from './layouts/AppLayout.vue';
import EmployerLayout from './layouts/EmployerLayout.vue';
import Home from './views/Home.vue';
import Account from './views/Account.vue';
import Employer from './views/Employer.vue';
import LoginEmployer from './views/LoginEmployer.vue';
import PageNotFound from './views/PageNotFound.vue';
import EditCompany from './views/EditCompany.vue';
import RegisterEmployer from './views/RegisterEmployer';
import ManagejobEmployer from './views/managejob.vue';
import ConfigCompany from './views/ConfigCompany.vue';
import AddJob from './views/AddJob.vue';
import Axios from 'axios';
const router = new VueRouter({
mode: 'history',
routes: [
{
path: '/employer',
name: 'employerLayout',
component: EmployerLayout,
children: [
{
path: '',
name: 'Employer',
component: Employer,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'login',
name: 'loginEmployer',
component: LoginEmployer
},
{
path: 'register',
name: 'registerEmployer',
component: RegisterEmployer
},
{
path: 'managejob',
name: 'managejobEmployer',
component: ManagejobEmployer,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'editcompany',
name: 'editcompany',
component: EditCompany,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'addjob',
name: 'addjob',
component: AddJob,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'configcompany',
name: 'configcompany',
component: ConfigCompany,
meta: {
loginEmployer: true
}
},
{
path: '*',
name: '404Employer',
component: PageNotFound
}
]
},
{
path: '/',
name: 'appLayout',
component: AppLayout,
children: [
{
path: '',
name: 'Home',
component: Home
},
{
path: 'account',
name: 'account',
component: Account
},
{
path: '*',
name: 'pageNotFound',
component: PageNotFound,
meta: {
requiredUser: true
}
}
]
}
]
})
router.beforeEach((to, from, next) => {
iView.LoadingBar.start();
if(to.matched.some(record => record.meta.requiredUser)) {
if(!localStorage.getItem('access_token')) {
next('/employer/login')
} else {
next()
}
} else {
next()
}
})
router.afterEach(route => {
iView.LoadingBar.finish();
})
export default router
\ No newline at end of file
import Vue from 'vue';
import VueRouter from 'vue-router';
import iView from 'iview';
Vue.use(VueRouter);
import AppLayout from './layouts/AppLayout.vue';
import EmployerLayout from './layouts/EmployerLayout.vue';
import Home from './views/Home.vue';
import Account from './views/Account.vue';
import Employer from './views/Employer.vue';
import LoginEmployer from './views/LoginEmployer.vue';
import PageNotFound from './views/PageNotFound.vue';
import EditCompany from './views/EditCompany.vue';
import RegisterEmployer from './views/RegisterEmployer';
import ManagejobEmployer from './views/managejob.vue';
import ConfigCompany from './views/ConfigCompany.vue';
import AddJob from './views/AddJob.vue';
import Axios from 'axios';
const router = new VueRouter({
mode: 'history',
routes: [
{
path: '/employer',
name: 'employerLayout',
component: EmployerLayout,
children: [
{
path: '',
name: 'Employer',
component: Employer,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'login',
name: 'loginEmployer',
component: LoginEmployer
},
{
path: 'register',
name: 'registerEmployer',
component: RegisterEmployer
},
{
path: 'managejob',
name: 'managejobEmployer',
component: ManagejobEmployer,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'editcompany',
name: 'editcompany',
component: EditCompany,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'createjob',
name: 'createjob',
component: CreateJob,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'configcompany',
name: 'configcompany',
component: ConfigCompany,
meta: {
loginEmployer: true
}
},
{
path: '*',
name: '404Employer',
component: PageNotFound
}
]
},
{
path: '/',
name: 'appLayout',
component: AppLayout,
children: [
{
path: '',
name: 'Home',
component: Home
},
{
path: 'account',
name: 'account',
component: Account
},
{
path: '*',
name: 'pageNotFound',
component: PageNotFound,
meta: {
requiredUser: true
}
}
]
}
]
})
router.beforeEach((to, from, next) => {
iView.LoadingBar.start();
if(to.matched.some(record => record.meta.requiredUser)) {
if(!localStorage.getItem('access_token')) {
next('/employer/login')
} else {
next()
}
} else {
next()
}
})
router.afterEach(route => {
iView.LoadingBar.finish();
})
export default router
\ No newline at end of file
import Vue from 'vue';
import VueRouter from 'vue-router';
import iView from 'iview';
Vue.use(VueRouter);
import AppLayout from './layouts/AppLayout.vue';
import EmployerLayout from './layouts/EmployerLayout.vue';
import Home from './views/Home.vue';
import Account from './views/Account.vue';
import Employer from './views/Employer.vue';
import LoginEmployer from './views/LoginEmployer.vue';
import PageNotFound from './views/PageNotFound.vue';
import EditCompany from './views/EditCompany.vue';
import RegisterEmployer from './views/RegisterEmployer';
import ManagejobEmployer from './views/managejob.vue';
import ConfigCompany from './views/ConfigCompany.vue';
import CreateJob from './views/CreateJob.vue';
import Axios from 'axios';
const router = new VueRouter({
mode: 'history',
routes: [
{
path: '/employer',
name: 'employerLayout',
component: EmployerLayout,
children: [
{
path: '',
name: 'Employer',
component: Employer,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'login',
name: 'loginEmployer',
component: LoginEmployer
},
{
path: 'register',
name: 'registerEmployer',
component: RegisterEmployer
},
{
path: 'managejob',
name: 'managejobEmployer',
component: ManagejobEmployer,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'editcompany',
name: 'editcompany',
component: EditCompany,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'createjob',
name: 'createjob',
component: CreateJob,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'configcompany',
name: 'configcompany',
component: ConfigCompany,
meta: {
loginEmployer: true
}
},
{
path: '*',
name: '404Employer',
component: PageNotFound
}
]
},
{
path: '/',
name: 'appLayout',
component: AppLayout,
children: [
{
path: '',
name: 'Home',
component: Home
},
{
path: 'account',
name: 'account',
component: Account
},
{
path: '*',
name: 'pageNotFound',
component: PageNotFound,
meta: {
requiredUser: true
}
}
]
}
]
})
router.beforeEach((to, from, next) => {
iView.LoadingBar.start();
if(to.matched.some(record => record.meta.requiredUser)) {
if(!localStorage.getItem('access_token')) {
next('/employer/login')
} else {
next()
}
} else {
next()
}
})
router.afterEach(route => {
iView.LoadingBar.finish();
})
export default router
\ No newline at end of file
import Vue from 'vue';
import VueRouter from 'vue-router';
import iView from 'iview';
Vue.use(VueRouter);
import AppLayout from './layouts/AppLayout.vue';
import EmployerLayout from './layouts/EmployerLayout.vue';
import Home from './views/Home.vue';
import Account from './views/Account.vue';
import Employer from './views/Employer.vue';
import LoginEmployer from './views/LoginEmployer.vue';
import PageNotFound from './views/PageNotFound.vue';
import EditCompany from './views/EditCompany.vue';
import RegisterEmployer from './views/RegisterEmployer';
import ManagejobEmployer from './views/managejob.vue';
import ConfigCompany from './views/ConfigCompany.vue';
import CreateJob from './views/CreateJob.vue';
import Axios from 'axios';
const router = new VueRouter({
mode: 'history',
routes: [
{
path: '/employer',
name: 'employerLayout',
component: EmployerLayout,
children: [
{
path: '',
name: 'Employer',
component: Employer,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'login',
name: 'loginEmployer',
component: LoginEmployer
},
{
path: 'register',
name: 'registerEmployer',
component: RegisterEmployer
},
{
path: 'managejob',
name: 'managejobEmployer',
component: ManagejobEmployer,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'editcompany',
name: 'editcompany',
component: EditCompany,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'createjob',
name: 'createjob',
component: CreateJob,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'configcompany',
name: 'configcompany',
component: ConfigCompany,
meta: {
loginEmployer: true
}
},
{
path: '*',
name: '404Employer',
component: PageNotFound
}
]
},
{
path: '/',
name: 'appLayout',
component: AppLayout,
children: [
{
path: '',
name: 'Home',
component: Home
},
{
path: 'showjob',
name: 'showjob',
component: ShowJob
},
{
path: 'account',
name: 'account',
component: Account
},
{
path: '*',
name: 'pageNotFound',
component: PageNotFound,
meta: {
requiredUser: true
}
}
]
}
]
})
router.beforeEach((to, from, next) => {
iView.LoadingBar.start();
if(to.matched.some(record => record.meta.requiredUser)) {
if(!localStorage.getItem('access_token')) {
next('/employer/login')
} else {
next()
}
} else {
next()
}
})
router.afterEach(route => {
iView.LoadingBar.finish();
})
export default router
\ No newline at end of file
import Vue from 'vue';
import VueRouter from 'vue-router';
import iView from 'iview';
Vue.use(VueRouter);
import AppLayout from './layouts/AppLayout.vue';
import EmployerLayout from './layouts/EmployerLayout.vue';
import Home from './views/Home.vue';
import Account from './views/Account.vue';
import Employer from './views/Employer.vue';
import LoginEmployer from './views/LoginEmployer.vue';
import PageNotFound from './views/PageNotFound.vue';
import EditCompany from './views/EditCompany.vue';
import RegisterEmployer from './views/RegisterEmployer';
import ManagejobEmployer from './views/managejob.vue';
import ConfigCompany from './views/ConfigCompany.vue';
import CreateJob from './views/CreateJob.vue';
import ShowJob from './views/ShowJob.vue';
const router = new VueRouter({
mode: 'history',
routes: [
{
path: '/employer',
name: 'employerLayout',
component: EmployerLayout,
children: [
{
path: '',
name: 'Employer',
component: Employer,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'login',
name: 'loginEmployer',
component: LoginEmployer
},
{
path: 'register',
name: 'registerEmployer',
component: RegisterEmployer
},
{
path: 'managejob',
name: 'managejobEmployer',
component: ManagejobEmployer,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'editcompany',
name: 'editcompany',
component: EditCompany,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'createjob',
name: 'createjob',
component: CreateJob,
meta: {
loginEmployer: true,
configProfile: true
}
},
{
path: 'configcompany',
name: 'configcompany',
component: ConfigCompany,
meta: {
loginEmployer: true
}
},
{
path: '*',
name: '404Employer',
component: PageNotFound
}
]
},
{
path: '/',
name: 'appLayout',
component: AppLayout,
children: [
{
path: '',
name: 'Home',
component: Home
},
{
path: 'showjob',
name: 'showjob',
component: ShowJob
},
{
path: 'account',
name: 'account',
component: Account
},
{
path: '*',
name: 'pageNotFound',
component: PageNotFound,
meta: {
requiredUser: true
}
}
]
}
]
})
router.beforeEach((to, from, next) => {
iView.LoadingBar.start();
if(to.matched.some(record => record.meta.requiredUser)) {
if(!localStorage.getItem('access_token')) {
next('/employer/login')
} else {
next()
}
} else {
next()
}
})
router.afterEach(route => {
iView.LoadingBar.finish();
})
export default router
\ No newline at end of file
import Vue from 'vue';
import Vuex from 'vuex';
import iView from 'iview';
Vue.use(Vuex);
export default new Vuex.Store({
state: {
message: 'Kittisak Maneewong',
user: {
name: null,
email: null
},
employer: {
id: null,
username: null,
company_name: null,
email: null
},
jwt: localStorage.getItem('access_token') || null,
jwt_employer: localStorage.getItem('access_token_employer') || null,
dialog: false,
snackbar: {
show: false,
color: null,
text: null
},
loading: false,
error: null,
time: {
date: '',
time: ''
}
},
mutations: {
setJwt (state, payload) {
state.jwt = payload
},
setJwtEmployer (state, payload) {
state.jwt_employer = payload
},
setDialog (state, payload) {
state.dialog = payload
},
setSnackbar (state, payload) {
state.snackbar = payload
},
setUser (state, payload) {
state.user = payload
},
setEmployer (state, payload) {
state.employer = payload
},
setLoading (state, payload) {
state.loading = payload
},
setError (state, payload) {
state.error = payload
},
setTime (state, payload) {
state.time = payload
}
},
actions: {
login ({commit, dispatch}, payload) {
return new Promise((resolve, reject) => {
commit('setLoading', true)
axios.post('/api/auth/login', payload)
.then(res => {
commit('setLoading', false)
if (payload.role == 1) {
iView.LoadingBar.finish()
localStorage.setItem('access_token', res.data.token)
commit('setJwt', res.data.token)
dispatch('checkUser')
} else {
localStorage.setItem('access_token_employer', res.data.token)
commit('setJwtEmployer', res.data.token)
dispatch('checkEmployer')
}
commit('setSnackbar', {
show: true,
color: 'success',
text: 'เข้าสู่ระบบสำเร็จ!'
})
commit('setDialog', false)
resolve(res)
console.log(res)
})
.catch(err => {
iView.LoadingBar.error()
commit('setLoading', false)
if (err.response.data.error === 'invalid_credentials') {
if (payload.role === 1) {
commit('setError', 'อีเมลหรือรหัสผ่านไม่ถูกต้อง')
} else {
commit('setError', 'ชื่อผู้ใช้หรือรหัสผ่านไม่ถูกต้อง')
}
setTimeout(() => {
commit('setError', null)
}, 4000);
}
console.log(err.response)
reject(err.response)
})
})
},
register ({commit}, payload) {
return new Promise((resolve, reject) => {
commit('setLoading', true)
axios.post('/api/auth/register', payload)
.then(res => {
if (payload.role === 1) {
iView.LoadingBar.finish()
}
commit('setLoading', false)
commit('setSnackbar', {
show: true,
color: 'success',
text: 'ลงทะเบียนสำเร็จ!'
})
commit('setDialog', false)
console.log(res)
resolve(res)
})
.catch(err => {
iView.LoadingBar.error()
commit('setLoading', false)
console.log(err.response)
const error = JSON.parse(err.response.data);
if (error.username && error.email) {
commit('setError', 'ชื่อผู้ใช้เเละอีเมลถูกใช้งานเเล้ว')
setTimeout(() => {
commit('setError', null)
}, 4000);
} else if (error.email) {
commit('setError', 'อีเมลนี้ถูกใช้งานเเล้ว')
setTimeout(() => {
commit('setError', null)
}, 4000);
errorMessage = 'อีเมลนี้ถูกใช้งานเเล้ว'
} else if (error.username) {
commit('setError', 'ชื่อผู้ใช้นี้ถูกใช้งานเเล้ว')
setTimeout(() => {
commit('setError', null)
}, 4000);
errorMessage = 'ชื่อผู้ใช้นี้ถูกใช้งานเเล้ว'
}
reject(err.response)
})
})
},
logout ({commit}) {
iView.LoadingBar.finish()
localStorage.removeItem('access_token')
commit('setUser', {
name: null,
email: null
})
commit('setSnackbar', {
show: true,
color: 'success',
text: 'ออกจากระบบสำเร็จ!'
})
},
logoutEmployer ({commit}) {
localStorage.removeItem('access_token_employer')
commit('setEmployer', {
username: null,
company_name: null,
email: null
})
commit('setSnackbar', {
show: true,
color: 'success',
text: 'ออกจากระบบสำเร็จ!'
})
},
checkUser ({commit}) {
if (!!localStorage.getItem('access_token')) {
axios.get('/api/auth/current', {
headers: {
Authorization: `Bearer ${localStorage.getItem('access_token')}`
}
})
.then(res => {
commit('setUser', {
name: res.data.user.name,
email: res.data.user.email_users
})
console.log(res)
})
.catch(err => {
console.log(err.response)
})
}
},
checkEmployer ({commit}) {
return new Promise((resolve, reject) => {
if (!!localStorage.getItem('access_token_employer')) {
axios.get('/api/auth/current', {
headers: {
Authorization: `Bearer ${localStorage.getItem('access_token_employer')}`
}
})
.then(res => {
resolve(res.data.user)
commit('setEmployer', {
id: res.data.user.id,
username: res.data.user.username,
company_name: res.data.user.company_name,
email: res.data.user.email_employers
})
// commit('setTime', res.headers.date)
const a = res.headers.date.split(',')[1].split(' ')
const date = a[1] + ' ' + a[2] + ' ' +a[3]
const b = res.headers.date.split(',')[1].split(' ')[4].split(':')
const time = ((b[0]*1 + 7) % 24) +':'+b[1]+':'+b[2]
commit('setTime', {
date: date,
time: time
})
})
.catch(err => {
console.log(err.response)
if (err.response.data.message === 'Token has expired') {
localStorage.removeItem('access_token_employer')
}
reject(err.response)
})
}
})
}
},
getters: {
welcome (state) {
return state.message
},
getJwt (state) {
return state.jwt
},
getJwtEmployer (state) {
return state.jwt_employer;
},
getDialog (state) {
return state.dialog
},
getSnackbar (state) {
return state.snackbar
},
getUser (state) {
return state.user
},
getEmployer (state) {
return state.employer
},
getLoading (state) {
return state.loading
},
getError (state) {
return state.error
},
getTime (state) {
return state.time
}
}
});
import Vue from 'vue';
import Vuex from 'vuex';
import iView from 'iview';
Vue.use(Vuex);
export default new Vuex.Store({
state: {
message: 'Kittisak Maneewong',
user: {
name: null,
email: null
},
employer: {
id: null,
username: null,
company_name: null,
email: null
},
jwt: localStorage.getItem('access_token') || null,
jwt_employer: localStorage.getItem('access_token_employer') || null,
dialog: false,
snackbar: {
show: false,
color: null,
text: null
},
loading: false,
error: null,
time: {
date: '',
time: ''
}
},
mutations: {
setJwt (state, payload) {
state.jwt = payload
},
setJwtEmployer (state, payload) {
state.jwt_employer = payload
},
setDialog (state, payload) {
state.dialog = payload
},
setSnackbar (state, payload) {
state.snackbar = payload
},
setUser (state, payload) {
state.user = payload
},
setEmployer (state, payload) {
state.employer = payload
},
setLoading (state, payload) {
state.loading = payload
},
setError (state, payload) {
state.error = payload
},
setTime (state, payload) {
state.time = payload
}
},
actions: {
login ({commit, dispatch}, payload) {
return new Promise((resolve, reject) => {
commit('setLoading', true)
axios.post('/api/auth/login', payload)
.then(res => {
commit('setLoading', false)
if (payload.role == 1) {
iView.LoadingBar.finish()
localStorage.setItem('access_token', res.data.token)
commit('setJwt', res.data.token)
dispatch('checkUser')
} else {
localStorage.setItem('access_token_employer', res.data.token)
commit('setJwtEmployer', res.data.token)
dispatch('checkEmployer')
}
commit('setSnackbar', {
show: true,
color: 'success',
text: 'เข้าสู่ระบบสำเร็จ!'
})
commit('setDialog', false)
resolve(res)
console.log(res)
})
.catch(err => {
iView.LoadingBar.error()
commit('setLoading', false)
if (err.response.data.error === 'invalid_credentials') {
if (payload.role === 1) {
commit('setError', 'อีเมลหรือรหัสผ่านไม่ถูกต้อง')
} else {
commit('setError', 'ชื่อผู้ใช้หรือรหัสผ่านไม่ถูกต้อง')
}
setTimeout(() => {
commit('setError', null)
}, 4000);
}
console.log(err.response)
reject(err.response)
})
})
},
register ({commit}, payload) {
return new Promise((resolve, reject) => {
commit('setLoading', true)
axios.post('/api/auth/register', payload)
.then(res => {
if (payload.role === 1) {
iView.LoadingBar.finish()
}
commit('setLoading', false)
commit('setSnackbar', {
show: true,
color: 'success',
text: 'ลงทะเบียนสำเร็จ!'
})
commit('setDialog', false)
console.log(res)
resolve(res)
})
.catch(err => {
iView.LoadingBar.error()
commit('setLoading', false)
console.log(err.response)
const error = JSON.parse(err.response.data);
if (error.username && error.email) {
commit('setError', 'ชื่อผู้ใช้เเละอีเมลถูกใช้งานเเล้ว')
setTimeout(() => {
commit('setError', null)
}, 4000);
} else if (error.email) {
commit('setError', 'อีเมลนี้ถูกใช้งานเเล้ว')
setTimeout(() => {
commit('setError', null)
}, 4000);
errorMessage = 'อีเมลนี้ถูกใช้งานเเล้ว'
} else if (error.username) {
commit('setError', 'ชื่อผู้ใช้นี้ถูกใช้งานเเล้ว')
setTimeout(() => {
commit('setError', null)
}, 4000);
errorMessage = 'ชื่อผู้ใช้นี้ถูกใช้งานเเล้ว'
}
reject(err.response)
})
})
},
logout ({commit}) {
iView.LoadingBar.finish()
localStorage.removeItem('access_token')
commit('setUser', {
name: null,
email: null
})
commit('setSnackbar', {
show: true,
color: 'success',
text: 'ออกจากระบบสำเร็จ!'
})
},
logoutEmployer ({commit}) {
localStorage.removeItem('access_token_employer')
commit('setEmployer', {
username: null,
company_name: null,
email: null
})
commit('setSnackbar', {
show: true,
color: 'success',
text: 'ออกจากระบบสำเร็จ!'
})
},
checkUser ({commit}) {
if (!!localStorage.getItem('access_token')) {
axios.get('/api/auth/current', {
headers: {
Authorization: `Bearer ${localStorage.getItem('access_token')}`
}
})
.then(res => {
commit('setUser', {
name: res.data.user.name,
email: res.data.user.email_users
})
console.log(res)
})
.catch(err => {
console.log(err.response)
})
}
},
checkEmployer ({commit}) {
return new Promise((resolve, reject) => {
if (!!localStorage.getItem('access_token_employer')) {
axios.get('/api/auth/current', {
headers: {
Authorization: `Bearer ${localStorage.getItem('access_token_employer')}`
}
})
.then(res => {
resolve(res.data.user)
commit('setEmployer', {
id: res.data.user.id,
username: res.data.user.username,
company_name: res.data.user.company_name,
email: res.data.user.email_employers
})
// commit('setTime', res.headers.date)
const a = res.headers.date.split(',')[1].split(' ')
const date = a[1] + ' ' + a[2] + ' ' +a[3]
const b = res.headers.date.split(',')[1].split(' ')[4].split(':')
const time = ((b[0]*1 + 7) % 24) +':'+b[1]+':'+b[2]
commit('setTime', {
date: date,
time: time
})
})
.catch(err => {
console.log(err.response)
if (err.response.data.message === 'Token has expired') {
console.log('fsadfas')
localStorage.removeItem('access_token_employer')
}
reject(err.response)
})
}
})
}
},
getters: {
welcome (state) {
return state.message
},
getJwt (state) {
return state.jwt
},
getJwtEmployer (state) {
return state.jwt_employer;
},
getDialog (state) {
return state.dialog
},
getSnackbar (state) {
return state.snackbar
},
getUser (state) {
return state.user
},
getEmployer (state) {
return state.employer
},
getLoading (state) {
return state.loading
},
getError (state) {
return state.error
},
getTime (state) {
return state.time
}
}
});
import Vue from 'vue';
import Vuex from 'vuex';
import iView from 'iview';
Vue.use(Vuex);
export default new Vuex.Store({
state: {
message: 'Kittisak Maneewong',
user: {
name: null,
email: null
},
employer: {
id: null,
username: null,
company_name: null,
email: null
},
jwt: localStorage.getItem('access_token') || null,
jwt_employer: localStorage.getItem('access_token_employer') || null,
dialog: false,
snackbar: {
show: false,
color: null,
text: null
},
loading: false,
error: null,
time: {
date: '',
time: ''
}
},
mutations: {
setJwt (state, payload) {
state.jwt = payload
},
setJwtEmployer (state, payload) {
state.jwt_employer = payload
},
setDialog (state, payload) {
state.dialog = payload
},
setSnackbar (state, payload) {
state.snackbar = payload
},
setUser (state, payload) {
state.user = payload
},
setEmployer (state, payload) {
state.employer = payload
},
setLoading (state, payload) {
state.loading = payload
},
setError (state, payload) {
state.error = payload
},
setTime (state, payload) {
state.time = payload
}
},
actions: {
login ({commit, dispatch}, payload) {
return new Promise((resolve, reject) => {
commit('setLoading', true)
axios.post('/api/auth/login', payload)
.then(res => {
commit('setLoading', false)
if (payload.role == 1) {
iView.LoadingBar.finish()
localStorage.setItem('access_token', res.data.token)
commit('setJwt', res.data.token)
dispatch('checkUser')
} else {
localStorage.setItem('access_token_employer', res.data.token)
commit('setJwtEmployer', res.data.token)
dispatch('checkEmployer')
}
commit('setSnackbar', {
show: true,
color: 'success',
text: 'เข้าสู่ระบบสำเร็จ!'
})
commit('setDialog', false)
resolve(res)
console.log(res)
})
.catch(err => {
iView.LoadingBar.error()
commit('setLoading', false)
if (err.response.data.error === 'invalid_credentials') {
if (payload.role === 1) {
commit('setError', 'อีเมลหรือรหัสผ่านไม่ถูกต้อง')
} else {
commit('setError', 'ชื่อผู้ใช้หรือรหัสผ่านไม่ถูกต้อง')
}
setTimeout(() => {
commit('setError', null)
}, 4000);
}
console.log(err.response)
reject(err.response)
})
})
},
register ({commit}, payload) {
return new Promise((resolve, reject) => {
commit('setLoading', true)
axios.post('/api/auth/register', payload)
.then(res => {
if (payload.role === 1) {
iView.LoadingBar.finish()
}
commit('setLoading', false)
commit('setSnackbar', {
show: true,
color: 'success',
text: 'ลงทะเบียนสำเร็จ!'
})
commit('setDialog', false)
console.log(res)
resolve(res)
})
.catch(err => {
iView.LoadingBar.error()
commit('setLoading', false)
console.log(err.response)
const error = JSON.parse(err.response.data);
if (error.username && error.email) {
commit('setError', 'ชื่อผู้ใช้เเละอีเมลถูกใช้งานเเล้ว')
setTimeout(() => {
commit('setError', null)
}, 4000);
} else if (error.email) {
commit('setError', 'อีเมลนี้ถูกใช้งานเเล้ว')
setTimeout(() => {
commit('setError', null)
}, 4000);
errorMessage = 'อีเมลนี้ถูกใช้งานเเล้ว'
} else if (error.username) {
commit('setError', 'ชื่อผู้ใช้นี้ถูกใช้งานเเล้ว')
setTimeout(() => {
commit('setError', null)
}, 4000);
errorMessage = 'ชื่อผู้ใช้นี้ถูกใช้งานเเล้ว'
}
reject(err.response)
})
})
},
logout ({commit}) {
iView.LoadingBar.finish()
localStorage.removeItem('access_token')
commit('setUser', {
name: null,
email: null
})
commit('setSnackbar', {
show: true,
color: 'success',
text: 'ออกจากระบบสำเร็จ!'
})
},
logoutEmployer ({commit}) {
localStorage.removeItem('access_token_employer')
commit('setEmployer', {
username: null,
company_name: null,
email: null
})
commit('setSnackbar', {
show: true,
color: 'success',
text: 'ออกจากระบบสำเร็จ!'
})
},
checkUser ({commit}) {
if (!!localStorage.getItem('access_token')) {
axios.get('/api/auth/current', {
headers: {
Authorization: `Bearer ${localStorage.getItem('access_token')}`
}
})
.then(res => {
commit('setUser', {
name: res.data.user.name,
email: res.data.user.email_users
})
console.log(res)
})
.catch(err => {
console.log(err.response)
})
}
},
checkEmployer ({commit}) {
return new Promise((resolve, reject) => {
if (!!localStorage.getItem('access_token_employer')) {
axios.get('/api/auth/current', {
headers: {
Authorization: `Bearer ${localStorage.getItem('access_token_employer')}`
}
})
.then(res => {
resolve(res.data.user)
commit('setEmployer', {
id: res.data.user.id,
username: res.data.user.username,
company_name: res.data.user.company_name,
email: res.data.user.email_employers
})
// commit('setTime', res.headers.date)
const a = res.headers.date.split(',')[1].split(' ')
const date = a[1] + ' ' + a[2] + ' ' +a[3]
const b = res.headers.date.split(',')[1].split(' ')[4].split(':')
const time = ((b[0]*1 + 7) % 24) +':'+b[1]+':'+b[2]
commit('setTime', {
date: date,
time: time
})
})
.catch(err => {
console.log(err.response)
if (err.response.data.message === 'Token has expired') {
localStorage.removeItem('access_token_employer')
}
reject(err.response)
})
}
})
}
},
getters: {
welcome (state) {
return state.message
},
getJwt (state) {
return state.jwt
},
getJwtEmployer (state) {
return state.jwt_employer;
},
getDialog (state) {
return state.dialog
},
getSnackbar (state) {
return state.snackbar
},
getUser (state) {
return state.user
},
getEmployer (state) {
return state.employer
},
getLoading (state) {
return state.loading
},
getError (state) {
return state.error
},
getTime (state) {
return state.time
}
}
});
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
<v-flex xs12 sm6 class="px-3"> <v-flex xs12 sm6 class="px-3">
<v-text-field <v-text-field
label="หัวข้องาน" label="หัวข้องาน"
v-model=""
placeholder=" " placeholder=" "
></v-text-field> ></v-text-field>
<v-select <v-select
......
<template>
<div class="">
<v-layout row wrap justify-center >
<v-flex xs12 sm10 offset-sm-1 class=" body-2 font-weight-bold"><span>หน้าหลัก / ประกาศงาน</span></v-flex>
<v-flex xs12 sm10 offset-sm-1 class="ma-2">
<v-flex class="bg-title pa-2">
<v-layout row wrap align-center>
<div class="mx-3">
<v-icon x-large dark>fas fa-briefcase</v-icon>
</div>
<div class="pa-0">
<v-flex xs12 sm12>
<span class="font-title font-weight-bold">ข้อมูลรายละเอียดของงาน</span>
</v-flex>
<v-flex xs12 sm12>
<span class="font-subtitle ">(Job description information)</span>
</v-flex>
</div>
</v-layout>
</v-flex>
<v-flex class="bg-body pa-4">
<v-layout row wrap>
<v-flex xs12 sm6 class="px-3">
<v-text-field
label="หัวข้องาน"
v-model="job_title"
placeholder=" "
></v-text-field>
<v-select
label="ประเภทงาน"
placeholder=" "
item-value="text"
></v-select>
<v-text-field
label="ตำแหน่งงาน "
placeholder=" "
></v-text-field>
<v-text-field
label="ค่าตอบแทน/เงินเดือน "
placeholder=" "
></v-text-field>
</v-flex>
<v-flex xs12 sm6 class="px-3">
<v-text-field
label="สาขาวิชาที่เปิดรับ "
placeholder=" "
></v-text-field>
<v-text-field
label="วันทำงาน "
placeholder=" "
></v-text-field>
<v-text-field
label="เวลาทำงาน "
placeholder=" "
></v-text-field>
<v-text-field
label="จำนวนที่รับ "
placeholder=" "
type="number"
></v-text-field>
</v-flex>
</v-layout>
</v-flex>
</v-flex>
<v-flex xs12 sm10 offset-sm-1 class="ma-2">
<v-flex class="bg-title-1 pa-2">
<v-layout row wrap align-center>
<div class="mx-3">
<v-icon x-large dark>fas fa-user-circle</v-icon>
</div>
<div class="pa-0">
<v-flex xs12 sm12>
<span class="font-title font-weight-bold">คุณสมบัติของผู้สมัครงาน</span>
</v-flex>
<v-flex xs12 sm12>
<span class="font-subtitle ">(Job applicant qualifications)</span>
</v-flex>
</div>
</v-layout>
</v-flex>
<v-flex class="bg-body pa-4">
<v-layout row wrap>
<v-flex xs12 sm6 class="px-3">
<v-combobox
v-model="gender"
:items="items"
label="เพศ"
placeholder=" "
multiple
>
<template v-slot:selection="data">
<v-chip
:key="JSON.stringify(data.item)"
:selected="data.selected"
:disabled="data.disabled"
class="v-chip--select-multi"
@input="data.parent.selectItem(data.item)"
>
<v-avatar
class="accent white--text"
v-text="data.item.slice(0, 1).toUpperCase()"
></v-avatar>
{{ data.item }}
</v-chip>
</template>
</v-combobox>
<v-select
label="ระดับการศึกษา"
placeholder=" "
item-value="text"
></v-select>
<v-text-field
label="เกรดเฉลี่ย "
placeholder=" "
></v-text-field>
<v-text-field
label="ระยะเวลาในการทำงาน "
placeholder=" "
></v-text-field>
<v-textarea
label="คุณสมบัติเพิ่มเติม"
rows="3"
outline
placeholder=" "
></v-textarea>
</v-flex>
<v-flex xs12 sm6 class="px-3">
<v-textarea
outline
label="หน้าที่รับผิดชอบ"
placeholder=" "
rows="7"
></v-textarea>
<v-textarea
outline
label="สวัสดิการ"
placeholder=" "
rows="7"
></v-textarea>
</v-flex>
</v-layout>
</v-flex>
</v-flex>
<v-flex xs12 sm10 offset-sm-1 class="my-1 text-xs-center text-sm-center."><v-btn round dark color="blue accent-3" class="px-3 white--text">เพิ่มข้อมูลงาน</v-btn></v-flex>
</v-layout>
</div>
</template>
<script>
export default {
data () {
return {
gender: [],
items: [
'ชาย',
'หญิง'
]
}
}
}
</script>
<style lang="scss" scoped>
.bg-title{
background-color: #00AAFF;
border-radius: 8px 8px 0 0;
display: block;
}
.bg-body{
background-color: #fff;
border-radius:0 0 8px 8px;
border-bottom:1px solid #dcdcdc ;
border-left:1px solid #dcdcdc ;
border-right:1px solid #dcdcdc ;
}
.bg-title-1{
background-color: #89969f;
border-radius: 8px 8px 0 0;
}
.font-title {
font-size: 20px;
color: #fff;
display: block;
font-family: "Prompt", sans-serif;
}
.font-subtitle {
font-size: 16px;
color: #2d3f4b;
display: block;
font-family: "Prompt", sans-serif;
}
</style>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment