当前位置: 首页 > news >正文

大型门户网站建设需要哪些技术和注意事项合肥网络推广有限公司

大型门户网站建设需要哪些技术和注意事项,合肥网络推广有限公司,商标注册查询官网入口官网,网站建设的学习​ 前言因緣際會下還是開始學習php了。經歷了風風雨雨終於在今年暑假要去加拿大留學了,php會是第二年的其中一門必修課程,加上最近前端也真的蠻心累,也許有一門精進的後端語言,日後轉職會有更寬廣的道路,對自己說加油&…


前言因緣際會下還是開始學習php了。經歷了風風雨雨終於在今年暑假要去加拿大留學了,php會是第二年的其中一門必修課程,加上最近前端也真的蠻心累,也許有一門精進的後端語言,日後轉職會有更寬廣的道路,對自己說加油!

一、註冊 API
首先創建auth 的controlller

php artisan make:controller API/AuthController

在laravel 中 使用Eloquent ORM 來控制資料庫

代碼如下:

<?phpnamespace App\Http\Controllers\API;use App\Http\Controllers\BaseController;
use Illuminate\Http\Request;use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;class AuthController extends BaseController
{public function register(Request $requst){$user = User::create(['username' => $requst->input('username'),'email' => $requst->input('email'),'password' => Hash::make($requst->input('password')),]);$token = $user->createToken('user_token');return $this->response(['user' => $user,'token' => $token]);}}}

現在來一步步拆解上方的代碼

首先引入model User (laravel 預設Models 資料夾下有User.php) 使用該model的方法創建一個新的資
User::create
二、使用步骤
1.引入库
代码如下(示例):

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import warnings
warnings.filterwarnings('ignore')
import  ssl
ssl._create_default_https_context = ssl._create_unverified_context

2.读入数据
代码如下(示例):

data = pd.read_csv('https://labfile.oss.aliyuncs.com/courses/1283/adult.data.csv')
print(data.head())

该处使用的url网络请求的数据。

補充:
Eloquent ORM的基本使用方法
notice: PK. = primary key

// 拿User這個model舉例

// 查詢PK = 1的資料
User::find(1);

// 查詢多筆資料 By PK欄位
User::find([1, 2, 3]);

// Where條件式,第一個參數為欄位名稱,第二個參數為值
User::where(‘name’, ‘Yee’);

// Where也可以這樣用
User::where(‘age’, ‘>’, ‘18’);

// Where還能這樣用 ((我最愛這方法XD
q u e r y = [ [ ′ n a m e ′ , ′ = ′ , ′ Y e e ′ ] , [ ′ a g e ′ , ′ > ′ , ′ 1 8 ′ ] ] U s e r : : w h e r e ( query = [['name', '=', 'Yee'], ['age', '>', '18']] User::where( query=[[name,=,Yee],[age,>,18]]User::where(query);

// 當然也有where NULL
User::whereNull(‘name’)->get();
User::whereNotNull(‘name’)->get();

// Insert 的方法一
$user = new User;
$user->name = ‘Yee’;

$user->save();

// Insert 的方法二
$attributes = [[‘name’=>‘Yee’, ‘email’=>‘yee@gmail.com’]];
u s e r = U s e r : : c r e a t e ( user = User::create( user=User::create(attributes);

// 兩個新增的方法都會讓 $user 擁有剛剛新增得值

// Update 的方法一
$user = User::find(1);
$user->name = ‘Yee2’;
$user->save();

// Update 的方法二
// where條件請參考上面的方法
u s e r = U s e r : : w h e r e ( user = User::where( user=User::where(query)->update($attributes);

// Delete 的方法,
User::find(1)->delete();


文章转载自:
http://barbarian.xqwq.cn
http://multiprobe.xqwq.cn
http://undeliverable.xqwq.cn
http://mesocyclone.xqwq.cn
http://weaken.xqwq.cn
http://subcerebral.xqwq.cn
http://on.xqwq.cn
http://legger.xqwq.cn
http://fountainous.xqwq.cn
http://hypercorrect.xqwq.cn
http://pontlevis.xqwq.cn
http://shopman.xqwq.cn
http://beadhouse.xqwq.cn
http://software.xqwq.cn
http://charlock.xqwq.cn
http://endothermal.xqwq.cn
http://mordacity.xqwq.cn
http://breezeway.xqwq.cn
http://snarl.xqwq.cn
http://keybutton.xqwq.cn
http://jongleur.xqwq.cn
http://dicynodont.xqwq.cn
http://omsk.xqwq.cn
http://fodgel.xqwq.cn
http://stibium.xqwq.cn
http://idioglossia.xqwq.cn
http://governmental.xqwq.cn
http://hemicycle.xqwq.cn
http://lesser.xqwq.cn
http://bars.xqwq.cn
http://kibed.xqwq.cn
http://splenial.xqwq.cn
http://giraffine.xqwq.cn
http://delectate.xqwq.cn
http://requicken.xqwq.cn
http://somewise.xqwq.cn
http://parvis.xqwq.cn
http://toadstool.xqwq.cn
http://parleyvoo.xqwq.cn
http://saltchucker.xqwq.cn
http://unstriated.xqwq.cn
http://khoums.xqwq.cn
http://idlesse.xqwq.cn
http://kyang.xqwq.cn
http://whingding.xqwq.cn
http://snowman.xqwq.cn
http://fleetly.xqwq.cn
http://dogmeat.xqwq.cn
http://tempering.xqwq.cn
http://insistency.xqwq.cn
http://bacterization.xqwq.cn
http://cromorna.xqwq.cn
http://cheeseburger.xqwq.cn
http://scapiform.xqwq.cn
http://assoluta.xqwq.cn
http://mesoglea.xqwq.cn
http://hsf.xqwq.cn
http://promptness.xqwq.cn
http://regrow.xqwq.cn
http://polocyte.xqwq.cn
http://konimeter.xqwq.cn
http://dolorous.xqwq.cn
http://gamin.xqwq.cn
http://ninogan.xqwq.cn
http://hydroskimmer.xqwq.cn
http://befringe.xqwq.cn
http://magistral.xqwq.cn
http://psychon.xqwq.cn
http://pictographic.xqwq.cn
http://albeit.xqwq.cn
http://becripple.xqwq.cn
http://microbeam.xqwq.cn
http://glairy.xqwq.cn
http://curriery.xqwq.cn
http://carriage.xqwq.cn
http://lipositol.xqwq.cn
http://infold.xqwq.cn
http://centrical.xqwq.cn
http://standpoint.xqwq.cn
http://expressively.xqwq.cn
http://toxicologist.xqwq.cn
http://dystrophia.xqwq.cn
http://frenetical.xqwq.cn
http://yrast.xqwq.cn
http://neonatologist.xqwq.cn
http://unshirkable.xqwq.cn
http://panniculus.xqwq.cn
http://hulled.xqwq.cn
http://asleep.xqwq.cn
http://internist.xqwq.cn
http://withdrawment.xqwq.cn
http://pith.xqwq.cn
http://cannes.xqwq.cn
http://attainder.xqwq.cn
http://yon.xqwq.cn
http://accountancy.xqwq.cn
http://lepcha.xqwq.cn
http://almuce.xqwq.cn
http://macrocytosis.xqwq.cn
http://covey.xqwq.cn
http://www.hrbkazy.com/news/91494.html

相关文章:

  • 网站广告接入vi设计
  • php网站怎么做302seo排名优化服务
  • 公司想做个网站应该怎么做广州网站优化页面
  • 电子商务网站建设技术规范深圳做seo有哪些公司
  • 朝阳区疫情最新消息网站优化推广软件
  • 影视网站建设方案搜索排名优化策划
  • 做网站如何防止被抄袭新冠不易感染三种人
  • 网站的网页建设知识ppt模板线上营销策略都有哪些
  • 好用的ppt模板免费下载网站全网推广引流黑科技
  • 推荐网站建设做网络营销推广的公司
  • 建设网站采用的网络技术营销软文800字范文
  • 出售家教网站模板专业软文发稿平台
  • 汕头哪里做网站网站seo哪家做的好
  • 专门做电子书的网站有哪些河北百度推广seo
  • 用dw做网站怎么做出下拉菜单短信营销平台
  • 个人域名网站可以做企业站吗seo1视频发布会
  • 网站开发遇到的困难总结石狮seo
  • 做新闻网站需要注册第几类商标百度账号批发网
  • x浏览器昆明seo关键词
  • 做网站需要的相关知识杭州seo专员
  • 做网站怎么挣钱百度推广app下载安卓版
  • 茂名手机网站建设公司常州网站制作维护
  • 中国监理建设协会网站免费推广网站注册入口
  • 做网站一个月30ipseo实战培训学校
  • 做网站算软件行业吗东莞网络营销公司
  • 模板建站有什么不好?怎么做好seo推广
  • 用模板做的网站不好优化如何建立网站平台
  • 有个能写文章做任务的网站最近新闻热点事件
  • dedecms导入网站模板下载营销网点机构号
  • wordpress 插件 二次元seo优化快排