我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

Laravel中的全局文件

Where do I store a php file ( functions.php) in the laravel directory, so that I can call functions in it from any controller? I understand I am to include it in all the files where I have to use the functions, but I'm not very clear on where I need to put the file itself.

You can put inside in your App directory.

After that add the following line to your App\start\global.php file

require app_path().'/functions.php';

That's it.

近期文章

  • MYSQL / PHP从相同列名的JOIN获取值
  • EMongoCriteria:限制和分组显示更少的行
  • 从一个表中选择字段并在另一个表中匹配并返回值[关闭]
  • 如何在wordpress的下拉菜单中按标题显示自定义帖子类型
  • 我想在视频的开头和结尾合并一些图像以生成新视频
  • 如何从父抽象类访问类属性到静态方法?
  • PHP输入&file_get_contents
  • 动态cookie域与PHP
  • 禁用行的PHP正则表达式以〜$开头
  • 构造一个foreach循环
  • Wordpress NextGen Gallery - 仅显示图库是否有图像
  • 用php从数据库中获取数据
  • PHP中可变范围的问题
  • 会话未在页面中反映[重复]
  • 覆盖PHP-FPM中的PHP设置
  • htaccess重写规则相同的域名
  • PHP,无法连接到MySQL服务器
  • Laravel remember_token存在但仍然错误
  • 使用facebook api获取用户数据。 php sdk
  • JSON.parse给了我对象而不是结果

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华