博客 第4页
资料

laravel数据库迁移

创建迁移文件,文件目录database/migrationsphp artisan make:migration create_users_table编写代码<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\...
47

SpringBoot 接口实现- JSR-303 参数校验

JSR-303JSR-303 是 JAVA EE 6 中的一项子规范,叫做 Bean Validation。说白了就是做参数校验。为什么要做参数验证?永远不要相信我们在后端接收到的用户数据,防止用户恶意通过伪造的参数破坏我...
45
安装PostgreSQL (Mac安装)软件开发-微信开发-商城开发-微信小程序-社区圈子论坛-APP开发-鸿蒙开发智小满

安装PostgreSQL (Mac安装)

下载dmg文件https://www.enterprisedb.com/downloads/postgres-postgresql-downloads安装,基本一路next打开终端# 14是刚才安装的对应的版本号 /Library/PostgreSQL/14/scripts/runpsql.sh ;exi...
45

laravel9通过migration修改enum类型的字段

1、安装 doctrine/dbal 包composer require doctrine/dbal2、config/database.php 配置文件添加以下代码use Illuminate\Database\DBAL\TimestampType; 'dbal' => [ 'types' => [ 'timest...
44

PHP去除HTML标签、图像等 仅保留文本

if (!function_exists('strip_html_tags')) { /** * 去除HTML标签、图像等 仅保留文本 * @param $str * @param int $length * @return array|string|string[]|null */ function strip_html_tags...
43

mac nginx服务器实现局域网内访问本地项目

找到nginx默认的配置文件/usr/local/etc/nginx/nginx.conf修改root,改成自己项目的路径http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 6...
42

laravel多语言设置

根据自己使用的laravel版本,composer安装对应的包 config/app.php中配置默认语言'locale' => 'zh_CN',将语言文件放置在resources/lang目录中(例:resources/lang/zh_CN/demo.php)<?ph...
42

composer更新及常用命令

查看版本号composer -V升级更新composer self-update全局配置(推荐)composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/取消配置composer config -g --unset r...
41

七牛云如何绑定自己的域名

七牛云的测试域名有效期是一个月,过期就不能使用了,所以需要绑定一个自己的域名。登录七牛云后台,在七牛云的'域名管理'中创建一个二级域名,创建完域名后会有一个CNAME值。到自己域名服务商...
41