Project Management Data Created Using PHP Laravel Framework
Project Management Data Created Using PHP Laravel Framework
Here in Project_Management_DataController.php page I will get the below output in the images once I command "// return view("showallProject_Management_Data")->with(['Project_Management_Data'=>$Project_Management_Data]);" and command out " dd($Project_Management_Data);//dump & die" this two lines in Project_Management_DataController.php page. Just this two lines I have make the changes to get the below output as shown in the images below.
Step 1 - First I have created one page under "C:\xampp\htdocs\Ayan_Home\Laravel\myApp\app\Models" by using the command in artisan terminal in VS Code "php artisan make:model Project_Management_Data".
Project_Management_Data.php:
<?php
namespace App\Models;
class Project_Management_Data
{
// DTO or DAO
// Data Transfer Object.
// Data Access Object.
public function getAllProject_Management_Data(){
return[
0=>['uid'=>10,'Project Name'=>'Marketing','Task Name'=>'Market_Research','Assigned to'=>'Alice','Start Date'=>'01-01-2024','Days Required'=>13,'End Date'=>'14-01-2024','Progress'=>'78%'],
1=>['uid'=>11,'Project Name'=>'Marketing','Task Name'=>'Content_Creation','Assigned to'=>'Bob','Start Date'=>'14-01-2024','Days Required'=>14,'End Date'=>'28-01-2024','Progress'=>'100%'],
2=>['uid'=>12,'Project Name'=>'Marketing','Task Name'=>'Social_Media_Planning','Assigned to'=>'Charlie','Start Date'=>'28-01-2024','Days Required'=>22,'End Date'=>'19-02-2024','Progress'=>'45%'],
3=>['uid'=>13,'Project Name'=>'Marketing','Task Name'=>'Campaign_Analysis','Assigned to'=>'Daisy','Start Date'=>'18-02-2024','Days Required'=>25,'End Date'=>'14-03-2024','Progress'=>'0%'],
4=>['uid'=>14,'Project Name'=>'Product Dev','Task Name'=>'Prototype_Development','Assigned to'=>'Ethan','Start Date'=>'02-01-2024','Days Required'=>18,'End Date'=>'20-01-2024','Progress'=>'100%'],
5=>['uid'=>15,'Project Name'=>'Product Dev','Task Name'=>'Quality_Assurance','Assigned to'=>'Fiona','Start Date'=>'20-01-2024','Days Required'=>10,'End Date'=>'30-01-2024','Progress'=>'78%'],
6=>['uid'=>16,'Project Name'=>'Customer Svc','Task Name'=>'Service_Improvement','Assigned to'=>'Hannah','Start Date'=>'01-02-2024','Days Required'=>22,'End Date'=>'23-02-2024','Progress'=>'100%'],
7=>['uid'=>17,'Project Name'=>'Customer Svc','Task Name'=>'Ticket_Resolution','Assigned to'=>'Ian','Start Date'=>'24-02-2024','Days Required'=>25,'End Date'=>'20-03-2024','Progress'=>'100%'],
8=>['uid'=>18,'Project Name'=>'Customer Svc','Task Name'=>'Customer_Feedback','Assigned to'=>'Julia','Start Date'=>'21-03-2024','Days Required'=>30,'End Date'=>'20-04-2024','Progress'=>'0%'],
9=>['uid'=>19,'Project Name'=>'Financial','Task Name'=>'Budget_Analysis','Assigned to'=>'Kevin','Start Date'=>'02-02-2024','Days Required'=>22,'End Date'=>'24-02-2024','Progress'=>'10%']
];
}
}
Step 2 - Then I have created another page under "C:\xampp\htdocs\Ayan_Home\Laravel\myApp\app\Http\Controllers" by using the command in artisan terminal in VS Code "php artisan make:controller Project_Management_DataController".
Project_Management_DataController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Project_Management_Data;
class Project_Management_DataController extends Controller
{
public function Project_Management_Datas()
{
//we need to use the Project_Management_Data Mopdel here.
$myProject_Management_Data=new Project_Management_Data();
$Project_Management_Data=$myProject_Management_Data->getAllProject_Management_Data();
// print '<pre>';
// print_r($Project_Management_Data);
// dd($Project_Management_Data);//dump & die
// ddd($Project_Management_Data);//dump die debug
return view("showallProject_Management_Data")->with(['Project_Management_Data'=>$Project_Management_Data]);
}
}
Step 3 - Then I have created another page under "C:\xampp\htdocs\Ayan_Home\Laravel\myApp\resources\views" by using the command in artisan terminal in VS Code "php artisan make:view showallProject_Management_Data".
showallProject_Management_Data.blade.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Project Management Data</title>
<!-- Add Bootstrap-4 CDN -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
</head>
<body>
<fieldset class="card p-5 m-5">
<legend>
<h4>Displaying All Project_Management_Data:</h4>
</legend>
@if(!empty($Project_Management_Data))
<table class="table table-hover">
<tr>
<th>UID:</th>
<th>Project Name:</th>
<th>Task Name:</th>
<th>Assigned to:</th>
<th>Start Date:</th>
<th>Days Required:</th>
<th>End Date:</th>
<th>Progress:</th>
</tr>
@foreach($Project_Management_Data as $Project_Management_Data)
<tr>
<td>{{$Project_Management_Data['uid']}}</td>
<td>{{$Project_Management_Data['Project Name']}}</td>
<td>{{$Project_Management_Data['Task Name']}}</td>
<td>{{$Project_Management_Data['Assigned to']}}</td>
<td>{{$Project_Management_Data['Start Date']}}</td>
<td>{{$Project_Management_Data['Days Required']}}</td>
<td>{{$Project_Management_Data['End Date']}}</td>
<td>{{$Project_Management_Data['Progress']}}</td>
</tr>
@endforeach
</table>
@endif
</fieldset>
</body>
</html>
Step 4 - Then I have added the below two lines in web.php which is present under "C:\xampp\htdocs\Ayan_Home\Laravel\myApp\routes\web.php".
Comments
Post a Comment