Версия PHP 8.1.
folder заменить на название папки
git clone [email protected]:Div-Man/laravel-parser-rss-.git folder
- Перейти в папку с проектом.
composer update
cp .env.example .env
php artisan key:generate
- Настроить подключение к БД в .env
php artisan migrate
При необходимости, если будет ошибка Permission denied, изменить доступ к папкам и файлам
sudo chown -R www-data:www-data storage/logs
sudo chown -R www-data:www-data storage/framework/sessions
sudo chown -R www-data:www-data storage/framework
sudo chown -R www-data:www-data storage/framework/cache
sudo chown -R $USER:www-data storage
sudo chown -R $USER:www-data bootstrap/cache
sudo chmod -R 775 storage
sudo chmod -R ugo+rw storage
Добавить ссылку, для отображения изображений
php artisan storage:link
Для парсинга RSS запустить команду:
php artisan app:parsing-news
(первый раз у меня парсится 3 минуты)
Если во время выполнения этой команды, будет ошибка Permission denied, то настроить права:
sudo chmod o+w ./storage/ -R
Роут Route::get('news/create', [NewsController::class, 'create']);
делает тоже самое.
Роут для отображения новостей http://localhost/news
Лайки и дизлайки добавляются с помощью axios.
Так как тегов в RSS нету, за место них, были взяты категории.
Для парсинга используется пакет Laravel Feed Reader.