Download the PHP package inova/nova-admin without Composer

On this page you can find all versions of the php package inova/nova-admin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nova-admin

nova-admin

多站点复用的通用后台底座(Laravel 12 + Filament 5):广告管理、站点设置、静态页面、ads.txt、robots.txt、后台中文、账号密码登录、默认管理员、后台 Logo 跳前台。


一、新建项目从零接入

1. 创建 Laravel 项目并安装本包

已依赖 Filament 5,无需单独安装。

默认 SQLite;用 MySQL 等先配 .env。 生产 APP_URL 须为完整 URL(如 https://example.com)——robots.txt 的 Sitemap 行按它生成。

2. 一键安装

一条命令搞定全部:接入 admin Panel、跑迁移、建默认管理员、初始化 robots/站点设置、 填充示例广告、发布静态资源、建 storage 软链。无需手动碰 AdminPanelProvider.php。

附带处理:公开文件(robots.txt/ads.txt/vendor/livewire)加入 .gitignore, App\Models\User 自动接入 FilamentUser + HasNovaAdminAccess(仅 users.is_admin 为真的用户可进后台, 默认管理员已标记;User 已有 canAccessPanel 的不动),并生成差异版 config/nova-admin.php。

3. 启动验证

访问 http://127.0.0.1:8000/admin → 用 nova / nova 登录。

上线前立即在后台改默认密码。


二、接入后你立即拥有

能力 入口
广告管理(一位多条、按序输出、代码框语法高亮) 后台「广告管理」
站点设置(基础/SEO/媒体/品牌) 后台「站点设置」
静态页面(关于/隐私/条款等富文本落地页,可增删改) 后台「静态页面」
ads.txt 编辑(DB + 静态文件双写,支持几千行大清单) 后台「Ads.txt」+ GET /ads.txt
站点广告配置下发(webdeploy 协议) php artisan ads:import-site-ad-config <file>
robots.txt 编辑(含默认模板) 后台「Robots.txt」+ GET /robots.txt
sitemap.xml(静态条目 + 项目注册动态来源,带缓存) GET /sitemap.xml
系统日志(查看尾部 / 下载 / 删除,兼容单文件与按天分割) 后台「系统日志」
账号密码登录 /admin/login(账号字段可配)
后台中文 自动
默认管理员 nova / nova
Logo 点击跳前台 后台左上角品牌

三、前台使用

广告位分两类:

enabled=false 时只输出 global_head(统计、站点验证这类站点级脚本任何页面都要加载)。 ad_disabled_views 里的视图(默认 pages.show、errors::404)会被注入 $section->ads_enabled = false。 nova-admin:doctor 扫描模板:内容位只放了一半、动态 :position、引用未启用的位直接失败; 内容位完全没放默认警告,--strict 时失败。项目测试里断言 nova-admin:doctor 退出码为 0 即可守住模板契约。

前台只读页面挂 nova.public 中间件组(不启会话、无 Cookie、带 Cache-Control,可进 CDN 边缘缓存), 缓存时长见 nova-admin.page_cache。包同时全局下发 HSTS(仅 HTTPS 请求,nova-admin.security.hsts 可关)。

static_pages.footer_views 里的视图(默认 layouts.app)会拿到 $footerPages:已启用的静态页,按 presets 顺序排列。

清 Cloudflare 边缘缓存

边缘副本最长留到当天结束。后台改了广告位、站点设置、静态页、ads.txt / robots.txt, 包会在请求 / 命令 / 队列任务结束时自动清本站(APP_URL 的 host)缓存,同一次操作多次写入只清一次。

项目自己的批量改动必须自己调,包感知不到:切换领域、清空或删除内容、切换主题、采集入库之后:

不清的后果:旧首页链着已删除的内容,访客点进去是 404,而 404 本身也会被边缘缓存。

需要 .env 里的 CLOUDFLARE_API_TOKEN(由 webdeploy 部署时写入;本包是公开仓库,不内置 token); zone 按域名自动查(只有 token 没有 Zone.Read 权限时才需要配 CLOUDFLARE_ZONE_ID)。local / testing 环境不清。

SEO 与站点设置

布局 <head> 里放 <x-nova-seo />,按后台「站点设置」输出 <title>(按 meta_title_template 拼装, 支持 {title}、{site_name}、%s)、description、keywords、canonical、favicon、OG / Twitter 卡片。 页面用 @section('title', 'About') 只写自身标题;description、keywords、canonical、robots、og_type、og_image 同理可用 section 或同名属性覆盖(属性写 og-type、image)。robots 有值才输出;og_type 默认 website; keywords 未覆盖时取站点设置。 未写 title 的页面(通常是首页)取「站点名 - 副标题」。

静态页面

后台「静态页面」管理关于、隐私政策、服务条款等富文本落地页。安装时按 nova-admin.static_pages.presets 预置一批页面(含 AdSense 法务五件套 + Cookie Policy), static_pages 表是唯一数据源——不要在项目里另建 pages 表镜像它,两套数据必然漂移。

约定:正文首个 <h1> 即页面标题(保存时自动提取为 title 并在 body_html 中剥离), Meta Description 留空时自动取正文摘要。前台模板契约三件套:

属性 说明
$page->title 页面标题(编辑器里的 H1)
$page->body_html 正文 HTML(已剥掉标题 H1,模板自行渲染 <h1>)
$page->meta_description SEO 摘要

前台路由:包内自带,新项目零代码

包默认注册 GET /{slug}(仅限 presets 内的 slug,不劫持其他 URL),路由名 pages.show, 默认用包内简洁模板渲染,激活页面自动进 sitemap。后台保存,前台立即生效。

有自己视觉的项目只换视图,路由和数据流不动:

多主题项目视图名需动态解析(如 theme_view('page'))时,关闭包路由自己写, 但数据仍读 static_page(),不要建自己的表:

零散场景仍可用 helper 按 slug 读取(仅返回已启用页面,未找到或停用返回 null):

body_html 为富文本 HTML,输出用 {!! !!}(内容由后台管理员录入,可信)。

Sitemap

包自带 GET /sitemap.xml(robots.txt 默认模板已指向它)。静态条目在 config nova-admin.sitemap.urls 配置;动态内容在项目 AppServiceProvider::boot 注册:

输出带缓存(sitemap.cache_ttl,默认 1800 秒),内容更新后可执行 php artisan nova-admin:clear-sitemap-cache 立即刷新;项目自带 sitemap 时置 sitemap.enabled = false 关闭包路由。


四、命令

建站预设(webdeploy 发起建站时预选领域 / 主题)

首次 seed 随机分配领域或主题的项目,可以让部署系统在发起建站时直接选:

  1. 每组预设实现一个 Inova\NovaAdmin\SitePresets\SitePresetProvider(options():slug ⇒ 显示名;newOptions():NEW 批次 slug)。
  2. 在 config/nova-admin.php 登记,键只能是小写字母与下划线:

  3. seeder 里随机的地方改成 site_preset('vertical') ?? 原随机逻辑。
  4. 运行 nova-admin:export-site-presets,提交生成的 site-presets.json。之后改清单不重新导出,nova-admin:doctor 会失败。

webdeploy 每天拉取各项目 master 上的 site-presets.json 渲染下拉;建站时把选中值作为 WEBDEPLOY_PRESET_<KEY> 传给部署脚本,脚本写进 .env 的 NOVA_PRESET_<KEY>。值不在清单内时 site_preset() 抛异常,部署失败。

建好之后的读取与切换:Provider 再实现 SwitchableSitePreset(current() 返回当前 slug,apply() 调用项目自己的切换逻辑并清缓存), webdeploy 网站详情「站点配置」经 nova-admin:site-ops 远程执行。负载与回包:

站点广告配置下发协议(webdeploy)

webdeploy 把 GAM 广告位代码与 ads.txt 打成一个 JSON 下发到站点,本命令负责落库:

任一部件 failed 时命令退出码为 1。协议键与本包 position 的对应关系在 config('nova-admin.ads_protocol.position_map'):协议键带下划线(home_banner_1), 本包 position 不带(home_banner1)。站点确实不用某个位时,在 ad_positions 与 position_map 里都写成 false;但保留不用的位没有代价,去掉反而会让平台勾到它时整体导入失败。

GPT 要求 slot 定义早于 enableServices,即 global_head 放最后——布局组件已保证这一点, 页面的 @stack('ad-head') 写在 <x-ad-layout-head /> 之前即可。


五、配置

nova-admin:install 生成差异版 config/nova-admin.php:宿主只写与包默认不同的部分, 升级包后新增的广告位、协议映射等自动继承。合并规则:

完整配置项见包内 config/nova-admin.php(vendor:publish --tag=nova-admin-config 可导出查看)。常用项:


六、新项目如何扩展后台功能


生产部署 / 升级

首次安装用 composer install,升级用 composer update inova/nova-admin,其余相同:

nova-admin:install 会自动处理 FilamentUser / HasNovaAdminAccess 接入(避免后台 403)、发布 Filament / Livewire 静态资源、storage:link 与公开文件忽略。

生产服务器需确保 storage/、public/vendor/livewire 归属 web 用户。若启用了 opcache.validate_timestamps=0,发布后 reload php-fpm。


All versions of nova-admin with dependencies

PHP Build Version
Package Version
Requires php Version ~8.2.0
laravel/framework Version ^12.0
filament/filament Version ^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package inova/nova-admin contains the following files

Loading the files please wait ...