abruno/unipvlectures

此包的最新版本(2.0.0)没有可用的许可信息。

该包允许从unipv工程网站检索讲座数据

2.0.0 2023-04-23 15:22 UTC

This package is auto-updated.

Last update: 2024-09-23 18:36:55 UTC


README

unipv/lectures

此包允许从帕维亚大学的工程网站检索数据。

安装

composer require abruno/unipvlectures  

包安装完成后,必须使用 artisan 命令 vendor:publish 发布包资源。

php artisan vendor:publish --provider="UnipvLectures\Providers\UnipvLectureProvider"

为了能够使用包资源,应在应用中注册包服务提供者。请访问文件 config/app.php

  'providers' => [
   
   // other service providers
   
   /*
   * Package Service Providers...
   */
   UnipvLectures\Providers\UnipvLectureProvider::class,

   // other Service Providers...
   
   ],

服务提供者配置完成后,并且发布了包资源,应运行迁移。

php artisan migrate

迁移将在您的数据库中创建 lectures, courses, teachers, teacher_courses。一旦表创建完成,必须调用 unipv:import-lectures 命令。

然后在 config/unipvlectures.php 中提供正确的配置,变量 courses_urlslectures_urls

php artisan unipv:lecturer-import

等待命令完成导入。

数据导入后,您可以开始创建一个 blade 模板。创建后,在配置 config/unipvlectures.php 中的 template 提供其名称。

  return [

    /*
    |--------------------------------------------------------------------------
    | Default Template
    |--------------------------------------------------------------------------
    |
    | This option controls the template used by the root to display data.
    |
    */

    'template' => '',

    /*
    |--------------------------------------------------------------------------
    | Urls used to retrieve Classes
    |--------------------------------------------------------------------------
    |
    | This option sets the url where to retrieve course names.
    |
    */

    'courses_urls' => [],

    /*
    |--------------------------------------------------------------------------
    | Urls used to retrieve Lecturers
    |--------------------------------------------------------------------------
    |
    | This option sets the url where to retrieve the lectures.
    |
    */

    'lectures_urls' => [],
];

要查看时间表,请打开链接


https://:8000/lectures