Below are the codes from my laravel project. Recently my task is to make another similar project but using ASP MVC. I have no idea how to convert these codes. I already tried some of the tutorials but still dont understand.
Route
Route::get('funitures_home','FurnitureController@index');
Model
class Furniture extends Model
{
public $table = 'furnitures';
protected $fillable = ['name'];
}
Controllers
class FurnitureController extends Controller
{
public function index(Request $request)
{
$fur = DB::table('furnitures')->join('price', 'price.id', '=', 'furnitures.priceId')->get();
return view('fur_page', compact('fur', 'request'));
}
}
View
<table class="table">
<thead>
<tr>
<th>Funiture Name</th>
<th>Furniture Price</th>
</tr>
</thead>
<tbody>
@foreach($fur as $fff)
<tr>
<td></td>
<td></td>
</tr>
@endforeach
</tbody>
</table>
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire