我在laravel中创建一个名为Project Management的项目。在该项目中,各种项目相关信息可以存储在数据库中,例如项目名称,开始日期,截止日期等。所有与项目相关的信息都可以显示在项目列表刀片文件中。现在我的问题是,当在projectlist刀片中添加项目时,如何更改表格行的颜色。
我的项目表代码
{
class CreateProjectsTable extends Migration
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('projects', function (Blueprint $table) {
$table->increments('id');
$table->string('project_title');
$table->string('type');
$table->string('category');
$table->text('description');
$table->string('image');
$table->string('url');
$table->date('starting_date');
$table->date('ending_date');
$table->string('remarks');
$table->string('assign_to');
$table->string('assign_by');
$table->string('team_member');
$table->string('status');
});
}
我的项目列表刀片文件
@extends('layouts.app')
@section('content')
<div class="container-fluid" style="margin-left: 250px">
<div class="row " style="margin-top: 0px">
<div class="col-md-4" id="sidebar-wrapper">
@include('sidebar')
</div>
<div class="col-md-8" >
<div class="card-header">{{ __('Project List') }}</div>
<table class="table" style="height: 800px; overflow-y: scroll">
<tr>
<th>Project Title</th>
<th>Type</th>
<th>Category</th>
<th>Description</th>
<th>URL</th>
<th>Starting Date</th>
<th>Ending Date</th>
<th>Remarks</th>
<th>Assign To</th>
<th>Assign By</th>
<th>Team Member</th>
<th>Image</th>
<th>Status</th>
<th>Action</th>
</tr>
@foreach($project as $item)
<tr>
<td>{!! $item['project_title'] !!}</td>
<td>{!! $item['type'] !!}</td>
<td>{!! $item['category']!!}</td>
<td>{!! $item['description'] !!}</td>
<td>{!! $item['url'] !!}</td>
<td>{!! $item['starting_date'] !!}</td>
<td>{!! $item['ending_date'] !!}</td>
<td>{!! $item['remarks'] !!}</td>
<td>{!! $item['assign_to'] !!}</td>
<td>{!! $item['assign_by'] !!}</td>
<td>{!! $item['team_member'] !!}</td>
<td><img src="{{url('images',$item->image)}}" style="height:50px; width: 60px; ">
{!! $item['image'] !!}</td>
<td>{!! $item['status'] !!}</td>
<td>
<a href="{{url('/project')}}/{{$item->id}}/{{'edit'}}" class="btn btn-primary btn-sm">Edit</a>
<a href="{{url('/project')}}/{{$item->id}}" class="btn btn-info btn-sm">Show</a>
<form action="{{url('/project')}}/{{$item->id}}" method="post">
@method('DELETE')
{!! csrf_field() !!}
<input type="submit" class="btn btn-danger btn-sm" value="Delete">
</form>
</td>
</tr>
@endforeach
</table>
</div>
</div>
</div>
@endsection