iT邦幫忙

2025 iThome 鐵人賽

DAY 21
0
Modern Web

Laravel 是甚麼系列 第 21

開始前端

  • 分享至 

  • xImage
  •  

修改路由
https://ithelp.ithome.com.tw/upload/images/20250918/20119035LKWYw90ZIW.png

改成
https://ithelp.ithome.com.tw/upload/images/20250918/20119035r1fqCvCsnh.png

增加前端的檔案
https://ithelp.ithome.com.tw/upload/images/20250918/201190352u7zYXZAF4.png
寫上
https://ithelp.ithome.com.tw/upload/images/20250918/20119035SugSLun3L4.png
在網頁看到localhost:8000
https://ithelp.ithome.com.tw/upload/images/20250918/20119035AUQPbEW3Bk.png
放上圖片:有時不能顯示就換另外一張
https://ithelp.ithome.com.tw/upload/images/20250918/2011903546sX7bl8vQ.png
貼到
https://ithelp.ithome.com.tw/upload/images/20250918/20119035FJsPinDC9N.png
程式碼:

HELLO
https://ithelp.ithome.com.tw/upload/images/20250918/20119035Kay41zd11s.png
超連結
複製網址https://newtalk.tw/news/view/2023-02-05/856096
https://ithelp.ithome.com.tw/upload/images/20250918/20119035QUEfw0l7o6.png
程式碼
點擊我
https://ithelp.ithome.com.tw/upload/images/20250918/20119035qxjxax8P91.png

顯示
https://ithelp.ithome.com.tw/upload/images/20250918/20119035suCktPdPTw.png
貼上影片
先到youtube
https://ithelp.ithome.com.tw/upload/images/20250918/20119035e7somnCeys.png
顯示
https://ithelp.ithome.com.tw/upload/images/20250918/201190357MoRE591ux.png
複製>貼上
https://ithelp.ithome.com.tw/upload/images/20250918/20119035EwmCZ61CFE.png
顯示

https://ithelp.ithome.com.tw/upload/images/20250918/20119035ahsE6a1VwZ.png

https://ithelp.ithome.com.tw/upload/images/20250918/20119035BgaIJh80hQ.png

https://ithelp.ithome.com.tw/upload/images/20250918/20119035PY21sIrUzh.png

https://ithelp.ithome.com.tw/upload/images/20250918/20119035yyZbi7Qmzp.png

程式碼:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\Product;

class WebController extends Controller
{
    public function index()
    {
        $products =Product::all();
        return view('web.index',['products' =>$products]);
    }

    public function contactUs()
    {
    }
}

加入資料夾
https://ithelp.ithome.com.tw/upload/images/20250918/20119035USds35J9mu.png
修改
https://ithelp.ithome.com.tw/upload/images/20250918/201190353kiticVHMO.png
畫面加入
https://ithelp.ithome.com.tw/upload/images/20250918/20119035GVqCQNj7B3.png
畫面看到:
127.0.0.1:8000
https://ithelp.ithome.com.tw/upload/images/20250918/20119035fNOPqrW6tt.png
加入圖片

程式碼:


<div>
  <a href="/">商品列表</a>
  <a href="/contactUs">聯絡我們</a>
</div>
<h2>商品列表</h2>
<img src="https://origaminojikan.com/wp-content/uploads/2022/10/origami_50892-500x375.jpg" with="600" heigh="400" alt="一張圖片">

https://ithelp.ithome.com.tw/upload/images/20250918/201190358RC4H5MDpl.png
大家明天見~


上一篇
測試CRUD含登入
下一篇
加入圖片跟表格
系列文
Laravel 是甚麼30
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言