Commit 1224e71f by Azhan Hannan

Model Project - add use eloquent softdeletes.

Maintenance controller - checking project code untuk new project.
parent d9153a0f
......@@ -105,7 +105,13 @@ class MaintenanceController extends Controller
public function addnewproject(Request $request)
{
// dd($request);
$checkcode = Project::where('p_project_code', $request->projectcode)
->first();
if($checkcode)
{
return redirect()->route('timesheet::maintenance.penambahanProject')->withErrors('Project code already exist. Kindly enter another code for the project.');
}
$chargeable = 1;
......@@ -115,7 +121,7 @@ class MaintenanceController extends Controller
if ($request->projectcode == null || $request->projectname == null || $request->projectmanager == null) {
return redirect()->route('timesheet::maintenance.penambahanProject')
->withErrors('The information is not complete. Please re-enter!');
->withErrors('The information is not complete. Please re-enter the details.');
} else {
......
......@@ -3,6 +3,7 @@
namespace Portal\Timesheet\Model;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Project extends Model
{
......@@ -11,6 +12,8 @@ class Project extends Model
*
* @var string
*/
use SoftDeletes;
protected $table = 'project';
public function projectManager()
......
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