Add adhadhu support
This commit is contained in:
48
.idea/baraveli-news.iml
generated
48
.idea/baraveli-news.iml
generated
@@ -2,11 +2,10 @@
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" packagePrefix="App\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="Tests\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/tests/Unit" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/tests/Feature" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/database/factories" isTestSource="false" packagePrefix="Database\Factories\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/database/seeders" isTestSource="false" packagePrefix="Database\Seeders\" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/asm89/stack-cors" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/brick/math" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
|
||||
@@ -116,6 +115,49 @@
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/vlucas/phpdotenv" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/voku/portable-ascii" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/webmozart/assert" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/storage/app" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/storage/debugbar" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/storage/framework" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/bacon/bacon-qr-code" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/barryvdh/laravel-debugbar" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/dasprid/enum" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/cache" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/dbal" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/deprecations" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/event-manager" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/firebase/php-jwt" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/google/apiclient" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/google/apiclient-services" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/google/auth" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/graham-campbell/result-type" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/jaybizzle/crawler-detect" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/jenssegers/agent" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/jinas/moosun" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/fortify" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/jetstream" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/sail" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/sanctum" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/league/mime-type-detection" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/livewire/livewire" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/maximebf/debugbar" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/mobiledetect/mobiledetectlib" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/paragonie/constant_time_encoding" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpseclib/phpseclib" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-invoker" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/pragmarx/google2fa" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/predis/predis" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/cache" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-client" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/realrashid/sweet-alert" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/cli-parser" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/complexity" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/lines-of-code" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/laravel-analytics" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/cache" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/cache-contracts" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/debug" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/var-exporter" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
|
121
.idea/blade.xml
generated
Normal file
121
.idea/blade.xml
generated
Normal file
@@ -0,0 +1,121 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="BladeInjectionConfiguration" default="false">
|
||||
<directives>
|
||||
<data directive="@append" />
|
||||
<data directive="@auth" injection="true" prefix="<?php if(auth()->guard(" suffix=")->check()): ?>" />
|
||||
<data directive="@aware" injection="true" prefix="<?php $__aware_exp = " suffix="?>" />
|
||||
<data directive="@break" injection="true" prefix="<?php if(" suffix=") break; ?>" />
|
||||
<data directive="@can" injection="true" prefix="<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check(" suffix=")): ?>" />
|
||||
<data directive="@canany" injection="true" prefix="<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(" suffix=")): ?>" />
|
||||
<data directive="@cannot" injection="true" prefix="<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->denies(" suffix=")): ?>" />
|
||||
<data directive="@case" injection="true" prefix="<?php case (" suffix="): ?>" />
|
||||
<data directive="@checked" injection="true" prefix="<?php if(" suffix="): echo 'checked'; endif; ?>" />
|
||||
<data directive="@choice" injection="true" prefix="<?php echo app('translator')->choice(" suffix="); ?>" />
|
||||
<data directive="@class" injection="true" prefix="class="<?php echo \Illuminate\Support\Arr::toCssClasses(" suffix=") ?>"" />
|
||||
<data directive="@component" injection="true" prefix="<?php $__env->startComponent(" suffix="); ?>" />
|
||||
<data directive="@componentfirst" injection="true" prefix="<?php $__env->startComponentFirst(" suffix="); ?>" />
|
||||
<data directive="@continue" injection="true" prefix="<?php if(" suffix=") continue; ?>" />
|
||||
<data directive="@csrf" />
|
||||
<data directive="@dd" injection="true" prefix="<?php dd(" suffix="); ?>" />
|
||||
<data directive="@default" />
|
||||
<data directive="@disabled" injection="true" prefix="<?php if(" suffix="): echo 'disabled'; endif; ?>" />
|
||||
<data directive="@dump" injection="true" prefix="<?php dump(" suffix="); ?>" />
|
||||
<data directive="@each" injection="true" prefix="<?php echo $__env->renderEach(" suffix="); ?>" />
|
||||
<data directive="@else" />
|
||||
<data directive="@elseauth" injection="true" prefix="<?php elseif(auth()->guard(" suffix=")->check()): ?>" />
|
||||
<data directive="@elsecan" injection="true" prefix="<?php elseif (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check(" suffix=")): ?>" />
|
||||
<data directive="@elsecanany" injection="true" prefix="<?php elseif (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(" suffix=")): ?>" />
|
||||
<data directive="@elsecannot" injection="true" prefix="<?php elseif (app(\Illuminate\Contracts\Auth\Access\Gate::class)->denies(" suffix=")): ?>" />
|
||||
<data directive="@elseguest" injection="true" prefix="<?php elseif(auth()->guard(" suffix=")->guest()): ?>" />
|
||||
<data directive="@elseif" injection="true" prefix="<?php elseif(" suffix="): ?>" />
|
||||
<data directive="@empty" injection="true" prefix="<?php if(empty(" suffix=")): ?>" />
|
||||
<data directive="@endauth" />
|
||||
<data directive="@endcan" />
|
||||
<data directive="@endcanany" />
|
||||
<data directive="@endcannot" />
|
||||
<data directive="@endcomponent" />
|
||||
<data directive="@endcomponentClass" />
|
||||
<data directive="@endcomponentfirst" />
|
||||
<data directive="@endempty" />
|
||||
<data directive="@endenv" />
|
||||
<data directive="@enderror" />
|
||||
<data directive="@endfor" />
|
||||
<data directive="@endforeach" />
|
||||
<data directive="@endforelse" />
|
||||
<data directive="@endfragment" />
|
||||
<data directive="@endguest" />
|
||||
<data directive="@endif" />
|
||||
<data directive="@endisset" />
|
||||
<data directive="@endlang" />
|
||||
<data directive="@endonce" />
|
||||
<data directive="@endphp" />
|
||||
<data directive="@endprepend" />
|
||||
<data directive="@endprependonce" />
|
||||
<data directive="@endproduction" />
|
||||
<data directive="@endpush" />
|
||||
<data directive="@endpushif" />
|
||||
<data directive="@endpushonce" />
|
||||
<data directive="@endsection" />
|
||||
<data directive="@endslot" />
|
||||
<data directive="@endswitch" />
|
||||
<data directive="@endunless" />
|
||||
<data directive="@endverbatim" />
|
||||
<data directive="@endwhile" />
|
||||
<data directive="@entangle" injection="true" prefix="<?php \print_r(" suffix="); ?>" />
|
||||
<data directive="@env" injection="true" prefix="<?php if(app()->environment(" suffix=")): ?>" />
|
||||
<data directive="@error" injection="true" prefix="<?php $__errorArgs = [" suffix="]; $__bag = $errors->getBag($__errorArgs[1] ?? 'default'); if ($__bag->has($__errorArgs[0])) : if (isset($message)) { $__messageOriginal = $message; } $message = $__bag->first($__errorArgs[0]); ?>" />
|
||||
<data directive="@extends" injection="true" prefix="<?php echo $__env->make(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>" />
|
||||
<data directive="@extendsfirst" injection="true" prefix="<?php echo $__env->first(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>" />
|
||||
<data directive="@for" injection="true" prefix="<?php for(" suffix="): ?>" />
|
||||
<data directive="@foreach" injection="true" prefix="<?php foreach(" suffix="): ?>" />
|
||||
<data directive="@forelse" injection="true" prefix="<?php foreach(" suffix="): ?>" />
|
||||
<data directive="@fragment" injection="true" prefix="<?php $__env->startFragment(" suffix="); ?>" />
|
||||
<data directive="@guest" injection="true" prefix="<?php if(auth()->guard(" suffix=")->guest()): ?>" />
|
||||
<data directive="@hasSection" injection="true" prefix="<?php if (! empty(trim($__env->yieldContent(" suffix=")))): ?>" />
|
||||
<data directive="@if" injection="true" prefix="<?php if(" suffix="): ?>" />
|
||||
<data directive="@include" injection="true" prefix="<?php echo $__env->make(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>" />
|
||||
<data directive="@includeFirst" injection="true" prefix="<?php echo $__env->first(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>" />
|
||||
<data directive="@includeUnless" injection="true" prefix="<?php echo $__env->renderUnless(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path'])); ?>" />
|
||||
<data directive="@includeWhen" injection="true" prefix="<?php echo $__env->renderWhen(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path'])); ?>" />
|
||||
<data directive="@isset" injection="true" prefix="<?php if(isset(" suffix=")): ?>" />
|
||||
<data directive="@js" injection="true" prefix="<?php echo \Illuminate\Support\Js::from(" suffix=")->toHtml() ?>" />
|
||||
<data directive="@json" injection="true" prefix="<?php echo json_encode(" suffix=") ?>" />
|
||||
<data directive="@lang" injection="true" prefix="<?php echo app('translator')->get(" suffix="); ?>" />
|
||||
<data directive="@livewire" injection="true" prefix="<?php \Livewire\Livewire::mount(" suffix="); ?>" />
|
||||
<data directive="@livewireScripts" />
|
||||
<data directive="@livewireStyles" />
|
||||
<data directive="@method" injection="true" prefix="<?php echo method_field(" suffix="); ?>" />
|
||||
<data directive="@once" />
|
||||
<data directive="@overwrite" />
|
||||
<data directive="@parent" />
|
||||
<data directive="@php" injection="true" prefix="<?php (" suffix="); ?>" />
|
||||
<data directive="@prepend" injection="true" prefix="<?php $__env->startPrepend(" suffix="); ?>" />
|
||||
<data directive="@prependonce" injection="true" prefix="<?php $___phpstorm_prepend_once_params = [" suffix="]; if (! $__env->hasRenderedOnce($___phpstorm_prepend_once_params[1])): $__env->markAsRenderedOnce($___phpstorm_prepend_once_params); $__env->startPrepend($___phpstorm_prepend_once_params[0]); ?>" />
|
||||
<data directive="@production" />
|
||||
<data directive="@props" injection="true" prefix="<?php $attributes = $attributes->exceptProps(" suffix="); ?>" />
|
||||
<data directive="@push" injection="true" prefix="<?php $__env->startPush(" suffix="); ?>" />
|
||||
<data directive="@pushif" injection="true" prefix="<?php $__pushif_args = explode(','," suffix=", 2); if({$__pushif_args[0]}): $__env->startPush({$__pushif_args[1]}); ?>" />
|
||||
<data directive="@pushonce" injection="true" prefix="<?php $__php_storm_push_once_params = [" suffix="]; if (!$__env->hasRenderedOnce($__php_storm_push_once_params[1])): $__env->markAsRenderedOnce($__php_storm_push_once_params[1]); $__env->startPush($__php_storm_push_once_params[0]); ?>" />
|
||||
<data directive="@readonly" injection="true" prefix="<?php if(" suffix="): echo 'readonly'; endif; ?>" />
|
||||
<data directive="@required" injection="true" prefix="<?php if(" suffix="): echo 'required'; endif; ?>" />
|
||||
<data directive="@section" injection="true" prefix="<?php $__env->startSection(" suffix="); ?>" />
|
||||
<data directive="@sectionMissing" injection="true" prefix="<?php if (empty(trim($__env->yieldContent(" suffix=")))): ?>" />
|
||||
<data directive="@selected" injection="true" prefix="<?php if(" suffix="): echo 'selected'; endif; ?>" />
|
||||
<data directive="@show" />
|
||||
<data directive="@slot" injection="true" prefix="<?php $__env->slot(" suffix="); ?>" />
|
||||
<data directive="@stack" injection="true" prefix="<?php echo $__env->yieldPushContent(" suffix="); ?>" />
|
||||
<data directive="@stop" />
|
||||
<data directive="@style" injection="true" prefix="style="<?php echo \Illuminate\Support\Arr::toCssStyles(" suffix=") ?>"" />
|
||||
<data directive="@switch" injection="true" prefix="<?php switch(" suffix="): ?>" />
|
||||
<data directive="@this" />
|
||||
<data directive="@unless" injection="true" prefix="<?php if (! (" suffix=")): ?>" />
|
||||
<data directive="@unset" injection="true" prefix="<?php unset(" suffix="); ?>" />
|
||||
<data directive="@verbatim" />
|
||||
<data directive="@vite" injection="true" prefix="<?php $__vite_arguments = " suffix=" ?? '()'; echo app(Illuminate\Foundation\Vite::class){$__vite_arguments}; ?>" />
|
||||
<data directive="@vitereactrefresh" />
|
||||
<data directive="@while" injection="true" prefix="<?php while(" suffix="): ?>" />
|
||||
<data directive="@yield" injection="true" prefix="<?php echo $__env->yieldContent(" suffix="); ?>" />
|
||||
</directives>
|
||||
</component>
|
||||
</project>
|
19
.idea/laravel-idea.xml
generated
Normal file
19
.idea/laravel-idea.xml
generated
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="LaravelIdeaMainSettings">
|
||||
<option name="codeGeneration">
|
||||
<LaravelCodeGeneration>
|
||||
<option name="generationStringSettings">
|
||||
<map>
|
||||
<entry key="createEloquentScope:inModuleNamespace" value="Models\Scopes" />
|
||||
<entry key="createEloquentScope:namespace" value="Models\Scopes" />
|
||||
<entry key="createModel:inModuleNamespace" value="Models" />
|
||||
<entry key="createModel:namespace" value="Models" />
|
||||
</map>
|
||||
</option>
|
||||
</LaravelCodeGeneration>
|
||||
</option>
|
||||
<option name="frameworkFound" value="true" />
|
||||
<option name="userClassName" value="\AppModels\User" />
|
||||
</component>
|
||||
</project>
|
58
.idea/php.xml
generated
58
.idea/php.xml
generated
@@ -1,5 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MessDetectorOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PHPCSFixerOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PHPCodeSnifferOptionsConfiguration">
|
||||
<option name="highlightLevel" value="WARNING" />
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PhpIncludePathManager">
|
||||
<include_path>
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/mime" />
|
||||
@@ -111,12 +121,58 @@
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/console" />
|
||||
<path value="$PROJECT_DIR$/vendor/nikic/php-parser" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/routing" />
|
||||
<path value="$PROJECT_DIR$/vendor/maximebf/debugbar" />
|
||||
<path value="$PROJECT_DIR$/vendor/pragmarx/google2fa" />
|
||||
<path value="$PROJECT_DIR$/vendor/jaybizzle/crawler-detect" />
|
||||
<path value="$PROJECT_DIR$/vendor/paragonie/constant_time_encoding" />
|
||||
<path value="$PROJECT_DIR$/vendor/doctrine/dbal" />
|
||||
<path value="$PROJECT_DIR$/vendor/doctrine/cache" />
|
||||
<path value="$PROJECT_DIR$/vendor/firebase/php-jwt" />
|
||||
<path value="$PROJECT_DIR$/vendor/livewire/livewire" />
|
||||
<path value="$PROJECT_DIR$/vendor/doctrine/deprecations" />
|
||||
<path value="$PROJECT_DIR$/vendor/doctrine/event-manager" />
|
||||
<path value="$PROJECT_DIR$/vendor/barryvdh/laravel-debugbar" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/cache-contracts" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/cache" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/var-exporter" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/debug" />
|
||||
<path value="$PROJECT_DIR$/vendor/laravel/fortify" />
|
||||
<path value="$PROJECT_DIR$/vendor/laravel/sanctum" />
|
||||
<path value="$PROJECT_DIR$/vendor/laravel/jetstream" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-invoker" />
|
||||
<path value="$PROJECT_DIR$/vendor/predis/predis" />
|
||||
<path value="$PROJECT_DIR$/vendor/spatie/laravel-analytics" />
|
||||
<path value="$PROJECT_DIR$/vendor/dasprid/enum" />
|
||||
<path value="$PROJECT_DIR$/vendor/laravel/sail" />
|
||||
<path value="$PROJECT_DIR$/vendor/google/apiclient-services" />
|
||||
<path value="$PROJECT_DIR$/vendor/google/auth" />
|
||||
<path value="$PROJECT_DIR$/vendor/google/apiclient" />
|
||||
<path value="$PROJECT_DIR$/vendor/league/mime-type-detection" />
|
||||
<path value="$PROJECT_DIR$/vendor/psr/http-client" />
|
||||
<path value="$PROJECT_DIR$/vendor/psr/cache" />
|
||||
<path value="$PROJECT_DIR$/vendor/bacon/bacon-qr-code" />
|
||||
<path value="$PROJECT_DIR$/vendor/jinas/moosun" />
|
||||
<path value="$PROJECT_DIR$/vendor/graham-campbell/result-type" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/complexity" />
|
||||
<path value="$PROJECT_DIR$/vendor/jenssegers/agent" />
|
||||
<path value="$PROJECT_DIR$/vendor/realrashid/sweet-alert" />
|
||||
<path value="$PROJECT_DIR$/vendor/mobiledetect/mobiledetectlib" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpseclib/phpseclib" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/lines-of-code" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/cli-parser" />
|
||||
</include_path>
|
||||
</component>
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="7.2" />
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="7.4" />
|
||||
<component name="PhpStanOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
<component name="PhpUnit">
|
||||
<phpunit_settings>
|
||||
<PhpUnitSettings configuration_file_path="$PROJECT_DIR$/phpunit.xml" custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" use_configuration_file="true" />
|
||||
</phpunit_settings>
|
||||
</component>
|
||||
<component name="PsalmOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
</project>
|
3
.idea/phpunit.xml
generated
3
.idea/phpunit.xml
generated
@@ -3,8 +3,7 @@
|
||||
<component name="PHPUnit">
|
||||
<option name="directories">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/tests/Unit" />
|
||||
<option value="$PROJECT_DIR$/tests/Feature" />
|
||||
<option value="$PROJECT_DIR$/tests" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
|
73
app/Console/Commands/ScrapeAdhadhuCommand.php
Normal file
73
app/Console/Commands/ScrapeAdhadhuCommand.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use App\Source;
|
||||
use App\Services\AdhadhuService;
|
||||
use App\Topic;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class ScrapeAdhadhuCommand extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'scrape:adhadhu';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Scrape Adhadhu';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$source = Source::where('slug', 'adhadhu')->first();
|
||||
|
||||
$articles = (new AdhadhuService)->scrape();
|
||||
|
||||
foreach ($articles as $article) {
|
||||
$articleModel = $source->articles()->updateOrCreate(
|
||||
["guid" => $article["guid"]],
|
||||
[
|
||||
"title" => $article["title"],
|
||||
"url" => $article["url"],
|
||||
"author" => $article["author"],
|
||||
"featured_image" => $article["image"],
|
||||
"body" => $article["content"],
|
||||
"published_date" => $article["date"],
|
||||
"meta" => [
|
||||
"title" => $article["og_title"]
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
collect($article["topics"])->each(function ($topic) use ($articleModel) {
|
||||
$topicModel = Topic::firstOrCreate(["slug" => $topic["slug"]], ["name" => $topic["name"]]);
|
||||
|
||||
$topicModel->articles()->syncWithoutDetaching($articleModel);
|
||||
});
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
@@ -101,8 +101,13 @@ class Kernel extends ConsoleKernel
|
||||
$schedule->command('scrape:dhiyares')->everyFiveMinutes()
|
||||
->runInBackground()
|
||||
->pingOnSuccess(config('app.url') . "/api/ping/dhiyares");
|
||||
|
||||
$schedule->command('scrape:adhadhu')->everyFiveMinutes()
|
||||
->runInBackground()
|
||||
->pingOnSuccess(config('app.url') . "/api/ping/adhadhu");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register the commands for the application.
|
||||
*
|
||||
|
29
app/Services/AdhadhuService.php
Normal file
29
app/Services/AdhadhuService.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Services\Feeds\AdhadhuFeed;
|
||||
use App\Services\Scrapers\AdhadhuScraper;
|
||||
|
||||
class AdhadhuService extends Client
|
||||
{
|
||||
/**
|
||||
* Scrap all the rss articles from Adhadhu
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function scrape(): array
|
||||
{
|
||||
$articles = (new AdhadhuFeed)->get();
|
||||
|
||||
$articleItems = [];
|
||||
foreach ($articles as $article) {
|
||||
$scrapedData = (new AdhadhuScraper)->extract($article["link"], $article["date"]);
|
||||
if ($scrapedData !== null) {
|
||||
$articleItems[] = $scrapedData;
|
||||
}
|
||||
}
|
||||
|
||||
return $articleItems;
|
||||
}
|
||||
}
|
82
app/Services/Feeds/AdhadhuFeed.php
Normal file
82
app/Services/Feeds/AdhadhuFeed.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Feeds;
|
||||
|
||||
use Goutte\Client;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class AdhadhuFeed implements Feed
|
||||
{
|
||||
protected $client;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->client = new Client();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the latest articles from Adhadhu
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get(): array
|
||||
{
|
||||
$crawler = $this->client->request('GET', "https://adhadhu.com/category/News");
|
||||
|
||||
$feeds = [];
|
||||
|
||||
// Parse the news articles
|
||||
$crawler->filter('div.category-news div.row div.list a.item, div.category-news div.row div.list a')->each(function ($node) use (&$feeds) {
|
||||
// Extract the details of each article
|
||||
$title = $node->filter('h4')->text();
|
||||
$link = $node->attr('href');
|
||||
$timeText = $node->filter('p.font-11')->text();
|
||||
// Extract the time and convert it to a Carbon instance
|
||||
$date = $this->extractDate($timeText);
|
||||
|
||||
$feeds[] = [
|
||||
"title" => trim($title),
|
||||
"link" => "https://adhadhu.com" . $link,
|
||||
"date" => $date
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
return $feeds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract and format the date from the text
|
||||
*
|
||||
* @param string $timeText
|
||||
* @return string
|
||||
*/
|
||||
protected function extractDate($timeText)
|
||||
{
|
||||
// A simple regex to extract numbers and time units (e.g., "minutes", "hours")
|
||||
if (preg_match('/(\d+)\s*(minute|hour|day|second)s?/', $timeText, $matches)) {
|
||||
$number = $matches[1];
|
||||
$unit = $matches[2];
|
||||
|
||||
// Use Carbon's sub method to subtract the time
|
||||
switch ($unit) {
|
||||
case 'minute':
|
||||
return Carbon::now()->subMinutes($number)->format('Y-m-d H:i:s');
|
||||
case 'hour':
|
||||
return Carbon::now()->subHours($number)->format('Y-m-d H:i:s');
|
||||
case 'day':
|
||||
return Carbon::now()->subDays($number)->format('Y-m-d H:i:s');
|
||||
case 'second':
|
||||
return Carbon::now()->subSeconds($number)->format('Y-m-d H:i:s');
|
||||
default:
|
||||
// Handle unexpected time unit
|
||||
return Carbon::now()->format('Y-m-d H:i:s');
|
||||
}
|
||||
} else {
|
||||
// Default to current time if parsing fails
|
||||
return Carbon::now()->format('Y-m-d H:i:s');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
65
app/Services/Scrapers/AdhadhuScraper.php
Normal file
65
app/Services/Scrapers/AdhadhuScraper.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Scrapers;
|
||||
|
||||
use Goutte\Client;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class AdhadhuScraper
|
||||
{
|
||||
protected $client;
|
||||
|
||||
protected $title;
|
||||
protected $content;
|
||||
protected $image;
|
||||
protected $topics = [];
|
||||
protected $author;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->client = new Client;
|
||||
}
|
||||
|
||||
public function extract($url, $date = null)
|
||||
{
|
||||
$crawler = $this->client->request('GET', $url);
|
||||
|
||||
// Extract title
|
||||
$this->title = $crawler->filter('h1.font-52')->first()->text();
|
||||
|
||||
// Extract image URL
|
||||
$this->image = $crawler->filter('img.img-fluid.hero-img')->first()->attr('src');
|
||||
|
||||
// Extract author name
|
||||
$this->author = $crawler->filter('.MuiAvatar-circle img')->first()->attr('alt');
|
||||
|
||||
// Extract content
|
||||
$crawler->filter('.body > p')->each(function ($node) {
|
||||
$this->content[] = $node->text();
|
||||
});
|
||||
|
||||
// Extract topics (tags)
|
||||
$crawler->filter('a[href^="/tags/"]')->each(function ($node) {
|
||||
$href = $node->attr('href');
|
||||
$slug = basename($href); // Extracts the last segment of the URL
|
||||
|
||||
$this->topics[] = [
|
||||
"name" => trim($node->filter('.tag')->first()->text()),
|
||||
"slug" => Str::slug($slug)
|
||||
];
|
||||
});
|
||||
|
||||
return [
|
||||
'source' => 'Adhadhu',
|
||||
'title' => $this->title,
|
||||
'og_title' => $crawler->filter('meta[property*="og:title"]')->first()->attr('content'),
|
||||
'image' => $this->image,
|
||||
'content' => $this->content,
|
||||
'url' => $url,
|
||||
'date' => $date,
|
||||
'guid' => str_replace("https://adhadhu.com/news/","",$url),
|
||||
'author' => $this->author,
|
||||
'topics' => $this->topics
|
||||
];
|
||||
}
|
||||
}
|
BIN
public/images/source/adhadhu.jpg
Normal file
BIN
public/images/source/adhadhu.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
Reference in New Issue
Block a user