随笔分类 - Laravel
摘要:执行docker-compose -f docker-compose.prod.yml exec app php artisan storage:linkThe [/var/www/public/storage] link has been connected to [/var/www/storage/app/public].The links have been created.执行【参考htt...
阅读全文
摘要:Heroku太贵 虽然deploy比较方便 但是要注意 Heroku默认的数据库是PGSQL需要配置 如果local开发的时候 用的mysql 那后面需要重新配置database.php还有就是 因为想蹭便宜 发现Heroku的静态存储资源是每天给爷刷新cite:https://stackoverflow.com/questions/24642967/can-i-host-images-in-he...
阅读全文
摘要:参考 https://devcenter.heroku.com/articles/getting-started-with-laravel即可注意的是,在使用pgsql的时候,database.php配置default 一定要修改mysql为pgsql 默认值 即使.env配置设置了pgsql也会报异常,其余的参考: env('DB_CONNECTION', 'mysql'), 'defau...
阅读全文
摘要:参考 https://dev.auth.nuxtjs.org/providers/laravel-jwt.html配置后发现不可用 然后打开https://auth.nuxtjs.org/ 却找不到上述配置了 于是只能做了两个auth strategyexport default { modules: [ // Doc: https://axios.nuxtjs.org/usage ...
阅读全文
摘要:执行php artisan queue:tablephp artisan migrate但是运行过程中我的没有向数据库中添加记录数据库会记录待处理的等,已经处理的会被删除掉。不执行 php artisan queue:work 就会看到代发的记录了。这是待处理的,一旦执行 php artisan queue:work就会处理掉,数据库中记录也就被移除了。不用执行php artisan make:j...
阅读全文
摘要:之前在自定义邮件的时候出现如下情况:莫名奇妙的多了其实是因为markdown语法会把所有的intent【缩进】也给解析了,cite:https://stackoverflow.com/questions/59113726/getting-markdown-email-as-a-plain-texthttps://laracasts.com/discuss/channels/laravel/weir...
阅读全文
摘要:实现重置密码逻辑:用户输入邮箱,点击发送重置邮件到本邮箱按钮,然后后端检测成功后,发送重置邮件给该邮箱。后端响应一个已发送邮件信息给用户。后端部分:api.php中添加route:新建这个PasswordResetController及添加create方法:执行:php artisan make:controller PasswordResetController用一个类来记录重置的请求信息,创建...
阅读全文
摘要:Likes PolyMorphic Relationship这个原教程的likes 其实可以就在post user topic 之间写非多态模型关联。为了示例,写这个多态的关联;一般情况下可以不这么写。更多可以参考:https://laravel.com/docs/7.x/eloquent-relationships#polymorphic-relationships逻辑上原教程就是把likes当...
阅读全文
摘要:Topic Update首先更新api.php添加一个routeTopicController.php增加这个update方法。update方法需要一个Request参数,直接用custom request 来处理,这样字段验证也方便。执行:php artisan make:request TopicUpdateRequest 'required|string|max:255', ]...
阅读全文
摘要:Moving to CRUDTopic Model and Post Model Migration执行:php artisan make:model Topic -mphp artisan make:model Post -mid(); $table->string('title'); $table->unsignedBigInteger('user_...
阅读全文
摘要:Middleware Clear Validation即点击登录,如果错误并出现了错误提示:再点击切换其他页面再切换回来的时候,错误提示还存在。所以需要用middleware 在页面切换了之后 clear掉这个validation errors信息。新建 middleware/clearValidationErrors.jsexport default function ({store}) { ...
阅读全文
摘要:Global Vuex Validation截至目前,注册,登录的输入验证还没有实现,所以继续:新建store/validation.jsexport const state = () => ({ errors: []})//gettersexport const getters = { errors(state) { return state.errors; }}//mutation...
阅读全文
摘要:Nuxt Auth Setup参考 https://auth.nuxtjs.org/#getting-started执行:npm install @nuxtjs/auth @nuxtjs/axiosnuxt.config.js修改:export default { mode: 'universal', /* ** Headers of the page */ head: { ti...
阅读全文
摘要:Setup Laravel JWT Authenticationhttps://jwt-auth.readthedocs.io/en/docs/laravel-installation/https://appdividend.com/2018/02/24/laravel-jwt-authentication-tutorial/https://blog.pusher.com/laravel-jwt/...
阅读全文
摘要:IntroLaravel SetUp新建一个Laravel Application,命名为backend用laragon新建laravel的教程 : https://www.cnblogs.com/dzkjz/p/12361718.htmlenv配置数据库设置。删除Controllers/Auth文件夹 如果有的话,因为需要从头定义auth的逻辑。删除welcome.blade.php ,清空a...
阅读全文
摘要:Deploy Static Site to Firebase Hosting官方文档: https://nuxtjs.org/guide/commands先示例 https://nuxtjs.org/guide/commands#static-generated-deployment-pre-rendered-需要注意的是,静态站点不能使用nuxtServerInit方法,所以,store/ind...
阅读全文
摘要:Installing and Using Plugins安装一个 vue scrollto 插件,主要是在底部增加一个滚动到顶部的按钮。要能够支持双端渲染的。执行:npm install vue-scrollto记得安装完成后执行npm run dev新建plugins/scrollto.js文件:import Vue from 'vue';import VueScrollTo from 'vue...
阅读全文
摘要:Vuex StoreLoading Image From Assets Folder下载一张图片到static文件夹内:修改assets/styles/main.css:body { background-color: azure;}div.jumbotron { border-radius: 0; background-image: url("/cbimage.jpg"); height...
阅读全文
摘要:Making Api Request The Vue Way新建pages/posts/index.vue文件: Making API request - the Vue way {{post.title}} 或者: Making API request - the Vue way {{p...
阅读全文
摘要:layouts/default中的nuxt标签作为nuxt的插槽,pages/index.vue会渲染至此。新建pages/users.vueroute自动处理好了【必须有执行npm run dev】,打开 http://localhost:3000/users 即可看到页面结果。view page source因为:.nuxt/router.js中已经自动生成好了》》》Creating Nest...
阅读全文

浙公网安备 33010602011771号