Compare commits

...

2 Commits

Author SHA1 Message Date
Giò 944c993739 refactor. 2024-07-01 20:30:31 +02:00
Giò 9cc2aad8dd Cleanup 2024-07-01 19:41:56 +02:00
13 changed files with 152 additions and 556 deletions

View File

@ -7,14 +7,6 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*/
protected function schedule(Schedule $schedule): void
{
// $schedule->command('inspire')->hourly();
}
/**
* Register the commands for the application.
*/

View File

@ -1,62 +0,0 @@
<?php
namespace App\Filament\Resources;
use App\Filament\Resources\ExceptionsResource\Pages;
use App\Filament\Resources\ExceptionsResource\RelationManagers;
use App\Models\Exception;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class ExceptionsResource extends Resource
{
protected static ?string $model = Exception::class;
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
public static function form(Form $form): Form
{
return $form
->schema([
//
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
//
])
->filters([
//
])
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
}
public static function getRelations(): array
{
return [
//
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListExceptions::route('/'),
];
}
}

View File

@ -1,19 +0,0 @@
<?php
namespace App\Filament\Resources\ExceptionsResource\Pages;
use App\Filament\Resources\ExceptionsResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;
class ListExceptions extends ListRecords
{
protected static string $resource = ExceptionsResource::class;
protected function getHeaderActions(): array
{
return [
//Actions\CreateAction::make(),
];
}
}

View File

@ -1,79 +0,0 @@
<?php
namespace App\Filament\Resources;
use App\Filament\Resources\PropertiesResource\Pages;
use App\Filament\Resources\PropertiesResource\RelationManagers;
use App\Models\Property;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Infolists\Components\TextEntry;
use Filament\Infolists\Infolist;
class PropertiesResource extends Resource
{
protected static ?string $model = Property::class;
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
public static function form(Form $form): Form
{
return $form
->schema([
//
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('property_platform_id')->label('Platform ID')->searchable(),
Tables\Columns\TextColumn::make('last_found')->label('Last found')->searchable(),
])
->filters([
//
])
->actions([
Tables\Actions\ViewAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
}
public static function infolist(Infolist $infolist): Infolist
{
return $infolist
->schema([
TextEntry::make('property_platform_id'),
TextEntry::make('last_found')
->dateTime(),
])
->columns(1)
->inlineLabel();
}
public static function getRelations(): array
{
return [
//RelationManagers\ExtractionsRelationManager::class,
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListProperties::route('/'),
//'create' => Pages\CreateProperties::route('/create'),
'view' => Pages\ViewProperties::route('/{record}'),
//'edit' => Pages\EditProperties::route('/{record}/edit'),
];
}
}

View File

@ -1,19 +0,0 @@
<?php
namespace App\Filament\Resources\PropertiesResource\Pages;
use App\Filament\Resources\PropertiesResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;
class ListProperties extends ListRecords
{
protected static string $resource = PropertiesResource::class;
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
];
}
}

View File

@ -1,14 +0,0 @@
<?php
namespace App\Filament\Resources\PropertiesResource\Pages;
use App\Filament\Resources\PropertiesResource;
use Filament\Infolists;
use Filament\Infolists\Infolist;
use Filament\Infolists\Components\TextEntry;
use Filament\Resources\Pages\ViewRecord;
class ViewProperties extends ViewRecord
{
protected static string $resource = PropertiesResource::class;
}

View File

@ -1,55 +0,0 @@
<?php
namespace App\Filament\Resources\PropertiesResource\RelationManagers;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class ExtractionsRelationManager extends RelationManager
{
protected static string $relationship = 'extractions';
public function isReadOnly(): bool
{
return true;
}
public function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('property_platform_id')
->required()
->maxLength(255),
]);
}
public function table(Table $table): Table
{
return $table
->recordTitleAttribute('property_platform_id')
->columns([
Tables\Columns\TextColumn::make('property_platform_id'),
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
]),
]);
}
}

View File

@ -1,58 +0,0 @@
<?php
namespace App\Providers\Filament;
use Filament\Http\Middleware\Authenticate;
use Filament\Http\Middleware\DisableBladeIconComponents;
use Filament\Http\Middleware\DispatchServingFilamentEvent;
use Filament\Pages;
use Filament\Panel;
use Filament\PanelProvider;
use Filament\Support\Colors\Color;
use Filament\Widgets;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Session\Middleware\AuthenticateSession;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\View\Middleware\ShareErrorsFromSession;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->default()
->id('admin')
->path('admin')
->login()
->colors([
'primary' => Color::Amber,
])
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
]);
}
}

View File

@ -9,9 +9,20 @@ use App\Jobs\ScrapeProperty;
use App\Jobs\ScrapePropertyData;
use Illuminate\Support\Facades\Http;
/**
* This Class contains methods for scraping offers from the
* website e-domizil.ch.
**/
class Edomizil{
public static function saveHttpException($response, $type, $entityId){
/**
* Save an exception.
* @param string $response The respsonse form an exception e.g. 404
* @param enum $type Is either 'offer', 'price', 'calendar' or 'property'
* @param integer $entityId Has to be the id of the corresponding entity.
**/
public static function saveHttpException($response, $type, $entityId)
{
$exception = [];
@ -29,52 +40,71 @@ class Edomizil{
}
/**
* Get seed urls.
* Get all seed urls (seeds.uris) in random order.
* @return Collection with seed urls.
**/
public static function getAllSeeds()
{
// get all seeds from model in random order.
return Seed::select('id','uri')->inRandomOrder()->get();
}
/**
* Get property ids.
* Get all ids (properties.property_platform_id) in random order.
* @return Collection with property id
**/
public static function getAllProperties()
{
// get all properties from model in random order.
return Property::select('id','property_platform_id')->inRandomOrder()->get();
}
public static function dispatchPropertyJobs()
{
$seeds = self::getAllSeeds();
foreach($seeds as $seed){
ScrapeProperty::dispatch($seed);
}
}
public static function dispatchPropertyDataJobs()
{
$properties = self::getAllProperties();
foreach($properties as $property){
ScrapePropertyData::dispatch($property);
}
}
/**
* Scrape for properties.
* Scrapes for properties form seed url and save them to the database.
* @param $seed Seed
**/
public static function scrapeProperty($seed)
{
$response = Http::get($seed->uri);
if($response->successful()){
$json = $response->json();
/** Check if offers are findable in response */
if(!$json['offers']){
Exception::create([
'exception' => 'No offers found for'.$seed->uri,
'entity_type' => 'property',
'entity_id' => $property->id
]);
return;
}
/** Iterate offers */
foreach($json['offers'] as $offer){
/**
* Check if property with same id is already present in database.
* If already present check if the geoLocation was the same as the first time when found.
* Otherwise add property to database.
**/
$property = Property::firstWhere('property_platform_id', $offer['id']);
$geoLocation = implode(',', $offer['geoLocation']);
if($property){
/** Update last found attribute */
$property->last_found = now();
$property->save();
// check if geoLocation is the same as last crawl
/** check if geoLocation is the same as at creation time and save exception if not */
if($property->check_data !== $geoLocation){
Exception::create([
'exception' => 'geoLocation was different: '.$geoLocation,
@ -82,6 +112,7 @@ class Edomizil{
'entity_id' => $property->id
]);
}
}else{
Property::create([
'property_platform_id' => $offer['id'],
@ -96,26 +127,32 @@ class Edomizil{
}else{
/** Save Exception if document could not be found */
self::saveHttpException($response,'property', $seed->id);
return 0;
}
}
/**
* Extract details from property.
* Scrapes for offer, price and calendar details from property and save the to extractions table (or exceptions when not found).
* @param $property Id of property (properties.property_platform_id)
**/
public static function scrapePropertyData($property){
$result = [];
// scrape offer details such as name etc.
/** scrape offer details such as name, ammeneties, etc. */
$offer = Http::get('https://www.e-domizil.ch/rental/offer/'.$property->property_platform_id);
if($offer->successful()){
if($offer->successful()){
Extraction::create([
'property_id' => $property->id,
'type' => 'offer',
'body' => $offer->body(),
'header' => json_encode($offer->headers())
]);
]);
}else{
self::saveHttpException($offer,'offer',$property->id);
@ -123,7 +160,7 @@ class Edomizil{
$result['offer'] = $offer->body();
// scrape price of property
/** scrape for price details */
$price = Http::get('https://www.e-domizil.ch/booking/checkout/priceDetails/'.$property->property_platform_id);
if($price->successful()){
@ -141,7 +178,7 @@ class Edomizil{
$result['price'] = $price->body();
// scrape calendar which contains occupancies
/** scrape for calendar details */
$calendar = Http::get('https://www.e-domizil.ch/api/v2/calendar/'.$property->property_platform_id, [
'year' => date("Y"),
'month' => date("m")
@ -166,5 +203,28 @@ class Edomizil{
}
}
/**
* Dispatch property jobs.
* Creates jobs for scraping new for properties
**/
public static function dispatchPropertyJobs()
{
$seeds = self::getAllSeeds();
foreach($seeds as $seed){
ScrapeProperty::dispatch($seed);
}
}
/**
* Dispatch property data jobs.
* Creates jobs for scraping new for property detail data.
**/
public static function dispatchPropertyDataJobs()
{
$properties = self::getAllProperties();
foreach($properties as $property){
ScrapePropertyData::dispatch($property);
}
}
}

View File

@ -1,3 +1,4 @@
{
"name": "laravel/laravel",
"type": "project",
@ -8,7 +9,6 @@
"php": "^8.1",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.10",
"laravel/sanctum": "^3.3",
"laravel/tinker": "^2.8"
},
"require-dev": {
@ -35,7 +35,8 @@
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
"@php artisan package:discover --ansi",
"@php artisan filament:upgrade"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"

192
scraper/composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "9c491b8531eec05ba41a11d9276a5749",
"content-hash": "2db4f4f45d5f19c3d1d1d0592de24b8a",
"packages": [
{
"name": "brick/math",
@ -1315,72 +1315,6 @@
},
"time": "2024-06-17T13:58:22+00:00"
},
{
"name": "laravel/sanctum",
"version": "v3.3.3",
"source": {
"type": "git",
"url": "https://github.com/laravel/sanctum.git",
"reference": "8c104366459739f3ada0e994bcd3e6fd681ce3d5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/sanctum/zipball/8c104366459739f3ada0e994bcd3e6fd681ce3d5",
"reference": "8c104366459739f3ada0e994bcd3e6fd681ce3d5",
"shasum": ""
},
"require": {
"ext-json": "*",
"illuminate/console": "^9.21|^10.0",
"illuminate/contracts": "^9.21|^10.0",
"illuminate/database": "^9.21|^10.0",
"illuminate/support": "^9.21|^10.0",
"php": "^8.0.2"
},
"require-dev": {
"mockery/mockery": "^1.0",
"orchestra/testbench": "^7.28.2|^8.8.3",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.6"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
},
"laravel": {
"providers": [
"Laravel\\Sanctum\\SanctumServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Laravel\\Sanctum\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.",
"keywords": [
"auth",
"laravel",
"sanctum"
],
"support": {
"issues": "https://github.com/laravel/sanctum/issues",
"source": "https://github.com/laravel/sanctum"
},
"time": "2023-12-19T18:44:48+00:00"
},
{
"name": "laravel/serializable-closure",
"version": "v1.3.3",
@ -1885,16 +1819,16 @@
},
{
"name": "monolog/monolog",
"version": "3.6.0",
"version": "3.7.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "4b18b21a5527a3d5ffdac2fd35d3ab25a9597654"
"reference": "f4393b648b78a5408747de94fca38beb5f7e9ef8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/4b18b21a5527a3d5ffdac2fd35d3ab25a9597654",
"reference": "4b18b21a5527a3d5ffdac2fd35d3ab25a9597654",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/f4393b648b78a5408747de94fca38beb5f7e9ef8",
"reference": "f4393b648b78a5408747de94fca38beb5f7e9ef8",
"shasum": ""
},
"require": {
@ -1970,7 +1904,7 @@
],
"support": {
"issues": "https://github.com/Seldaek/monolog/issues",
"source": "https://github.com/Seldaek/monolog/tree/3.6.0"
"source": "https://github.com/Seldaek/monolog/tree/3.7.0"
},
"funding": [
{
@ -1982,7 +1916,7 @@
"type": "tidelift"
}
],
"time": "2024-04-12T21:02:21+00:00"
"time": "2024-06-28T09:40:51+00:00"
},
{
"name": "nesbot/carbon",
@ -3176,16 +3110,16 @@
},
{
"name": "symfony/console",
"version": "v6.4.8",
"version": "v6.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "be5854cee0e8c7b110f00d695d11debdfa1a2a91"
"reference": "6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/be5854cee0e8c7b110f00d695d11debdfa1a2a91",
"reference": "be5854cee0e8c7b110f00d695d11debdfa1a2a91",
"url": "https://api.github.com/repos/symfony/console/zipball/6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9",
"reference": "6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9",
"shasum": ""
},
"require": {
@ -3250,7 +3184,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v6.4.8"
"source": "https://github.com/symfony/console/tree/v6.4.9"
},
"funding": [
{
@ -3266,7 +3200,7 @@
"type": "tidelift"
}
],
"time": "2024-05-31T14:49:08+00:00"
"time": "2024-06-28T09:49:33+00:00"
},
{
"name": "symfony/css-selector",
@ -3402,16 +3336,16 @@
},
{
"name": "symfony/error-handler",
"version": "v6.4.8",
"version": "v6.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/error-handler.git",
"reference": "ef836152bf13472dc5fb5b08b0c0c4cfeddc0fcc"
"reference": "c9b7cc075b3ab484239855622ca05cb0b99c13ec"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/error-handler/zipball/ef836152bf13472dc5fb5b08b0c0c4cfeddc0fcc",
"reference": "ef836152bf13472dc5fb5b08b0c0c4cfeddc0fcc",
"url": "https://api.github.com/repos/symfony/error-handler/zipball/c9b7cc075b3ab484239855622ca05cb0b99c13ec",
"reference": "c9b7cc075b3ab484239855622ca05cb0b99c13ec",
"shasum": ""
},
"require": {
@ -3457,7 +3391,7 @@
"description": "Provides tools to manage errors and ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/error-handler/tree/v6.4.8"
"source": "https://github.com/symfony/error-handler/tree/v6.4.9"
},
"funding": [
{
@ -3473,7 +3407,7 @@
"type": "tidelift"
}
],
"time": "2024-05-31T14:49:08+00:00"
"time": "2024-06-21T16:04:15+00:00"
},
{
"name": "symfony/event-dispatcher",
@ -3774,16 +3708,16 @@
},
{
"name": "symfony/http-kernel",
"version": "v6.4.8",
"version": "v6.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "6c519aa3f32adcfd1d1f18d923f6b227d9acf3c1"
"reference": "cc4a9bec6e1bdd2405f40277a68a6ed1bb393005"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/6c519aa3f32adcfd1d1f18d923f6b227d9acf3c1",
"reference": "6c519aa3f32adcfd1d1f18d923f6b227d9acf3c1",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/cc4a9bec6e1bdd2405f40277a68a6ed1bb393005",
"reference": "cc4a9bec6e1bdd2405f40277a68a6ed1bb393005",
"shasum": ""
},
"require": {
@ -3868,7 +3802,7 @@
"description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-kernel/tree/v6.4.8"
"source": "https://github.com/symfony/http-kernel/tree/v6.4.9"
},
"funding": [
{
@ -3884,20 +3818,20 @@
"type": "tidelift"
}
],
"time": "2024-06-02T16:06:25+00:00"
"time": "2024-06-28T11:48:06+00:00"
},
{
"name": "symfony/mailer",
"version": "v6.4.8",
"version": "v6.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/mailer.git",
"reference": "76326421d44c07f7824b19487cfbf87870b37efc"
"reference": "e2d56f180f5b8c5e7c0fbea872bb1f529b6d6d45"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/mailer/zipball/76326421d44c07f7824b19487cfbf87870b37efc",
"reference": "76326421d44c07f7824b19487cfbf87870b37efc",
"url": "https://api.github.com/repos/symfony/mailer/zipball/e2d56f180f5b8c5e7c0fbea872bb1f529b6d6d45",
"reference": "e2d56f180f5b8c5e7c0fbea872bb1f529b6d6d45",
"shasum": ""
},
"require": {
@ -3948,7 +3882,7 @@
"description": "Helps sending emails",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/mailer/tree/v6.4.8"
"source": "https://github.com/symfony/mailer/tree/v6.4.9"
},
"funding": [
{
@ -3964,20 +3898,20 @@
"type": "tidelift"
}
],
"time": "2024-05-31T14:49:08+00:00"
"time": "2024-06-28T07:59:05+00:00"
},
{
"name": "symfony/mime",
"version": "v6.4.8",
"version": "v6.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/mime.git",
"reference": "618597ab8b78ac86d1c75a9d0b35540cda074f33"
"reference": "7d048964877324debdcb4e0549becfa064a20d43"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/mime/zipball/618597ab8b78ac86d1c75a9d0b35540cda074f33",
"reference": "618597ab8b78ac86d1c75a9d0b35540cda074f33",
"url": "https://api.github.com/repos/symfony/mime/zipball/7d048964877324debdcb4e0549becfa064a20d43",
"reference": "7d048964877324debdcb4e0549becfa064a20d43",
"shasum": ""
},
"require": {
@ -3991,7 +3925,7 @@
"phpdocumentor/reflection-docblock": "<3.2.2",
"phpdocumentor/type-resolver": "<1.4.0",
"symfony/mailer": "<5.4",
"symfony/serializer": "<6.3.2"
"symfony/serializer": "<6.4.3|>7.0,<7.0.3"
},
"require-dev": {
"egulias/email-validator": "^2.1.10|^3.1|^4",
@ -4001,7 +3935,7 @@
"symfony/process": "^5.4|^6.4|^7.0",
"symfony/property-access": "^5.4|^6.0|^7.0",
"symfony/property-info": "^5.4|^6.0|^7.0",
"symfony/serializer": "^6.3.2|^7.0"
"symfony/serializer": "^6.4.3|^7.0.3"
},
"type": "library",
"autoload": {
@ -4033,7 +3967,7 @@
"mime-type"
],
"support": {
"source": "https://github.com/symfony/mime/tree/v6.4.8"
"source": "https://github.com/symfony/mime/tree/v6.4.9"
},
"funding": [
{
@ -4049,7 +3983,7 @@
"type": "tidelift"
}
],
"time": "2024-06-01T07:50:16+00:00"
"time": "2024-06-28T09:49:33+00:00"
},
{
"name": "symfony/polyfill-ctype",
@ -4990,16 +4924,16 @@
},
{
"name": "symfony/string",
"version": "v7.1.1",
"version": "v7.1.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
"reference": "60bc311c74e0af215101235aa6f471bcbc032df2"
"reference": "14221089ac66cf82e3cf3d1c1da65de305587ff8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/60bc311c74e0af215101235aa6f471bcbc032df2",
"reference": "60bc311c74e0af215101235aa6f471bcbc032df2",
"url": "https://api.github.com/repos/symfony/string/zipball/14221089ac66cf82e3cf3d1c1da65de305587ff8",
"reference": "14221089ac66cf82e3cf3d1c1da65de305587ff8",
"shasum": ""
},
"require": {
@ -5057,7 +4991,7 @@
"utf8"
],
"support": {
"source": "https://github.com/symfony/string/tree/v7.1.1"
"source": "https://github.com/symfony/string/tree/v7.1.2"
},
"funding": [
{
@ -5073,7 +5007,7 @@
"type": "tidelift"
}
],
"time": "2024-06-04T06:40:14+00:00"
"time": "2024-06-28T09:27:18+00:00"
},
{
"name": "symfony/translation",
@ -5324,16 +5258,16 @@
},
{
"name": "symfony/var-dumper",
"version": "v6.4.8",
"version": "v6.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "ad23ca4312395f0a8a8633c831ef4c4ee542ed25"
"reference": "c31566e4ca944271cc8d8ac6887cbf31b8c6a172"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/ad23ca4312395f0a8a8633c831ef4c4ee542ed25",
"reference": "ad23ca4312395f0a8a8633c831ef4c4ee542ed25",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/c31566e4ca944271cc8d8ac6887cbf31b8c6a172",
"reference": "c31566e4ca944271cc8d8ac6887cbf31b8c6a172",
"shasum": ""
},
"require": {
@ -5389,7 +5323,7 @@
"dump"
],
"support": {
"source": "https://github.com/symfony/var-dumper/tree/v6.4.8"
"source": "https://github.com/symfony/var-dumper/tree/v6.4.9"
},
"funding": [
{
@ -5405,7 +5339,7 @@
"type": "tidelift"
}
],
"time": "2024-05-31T14:49:08+00:00"
"time": "2024-06-27T13:23:14+00:00"
},
{
"name": "tijsverkoyen/css-to-inline-styles",
@ -6351,16 +6285,16 @@
},
{
"name": "phpunit/php-code-coverage",
"version": "10.1.14",
"version": "10.1.15",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b"
"reference": "5da8b1728acd1e6ffdf2ff32ffbdfd04307f26ae"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e3f51450ebffe8e0efdf7346ae966a656f7d5e5b",
"reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5da8b1728acd1e6ffdf2ff32ffbdfd04307f26ae",
"reference": "5da8b1728acd1e6ffdf2ff32ffbdfd04307f26ae",
"shasum": ""
},
"require": {
@ -6417,7 +6351,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.14"
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.15"
},
"funding": [
{
@ -6425,7 +6359,7 @@
"type": "github"
}
],
"time": "2024-03-12T15:33:41+00:00"
"time": "2024-06-29T08:25:15+00:00"
},
{
"name": "phpunit/php-file-iterator",
@ -7752,16 +7686,16 @@
},
{
"name": "spatie/error-solutions",
"version": "1.0.3",
"version": "1.0.4",
"source": {
"type": "git",
"url": "https://github.com/spatie/error-solutions.git",
"reference": "55ea4117e0fde89d520883734ab9b71064c48876"
"reference": "264a7eef892aceb2fd65e206127ad3af4f3a2d6b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/error-solutions/zipball/55ea4117e0fde89d520883734ab9b71064c48876",
"reference": "55ea4117e0fde89d520883734ab9b71064c48876",
"url": "https://api.github.com/repos/spatie/error-solutions/zipball/264a7eef892aceb2fd65e206127ad3af4f3a2d6b",
"reference": "264a7eef892aceb2fd65e206127ad3af4f3a2d6b",
"shasum": ""
},
"require": {
@ -7814,7 +7748,7 @@
],
"support": {
"issues": "https://github.com/spatie/error-solutions/issues",
"source": "https://github.com/spatie/error-solutions/tree/1.0.3"
"source": "https://github.com/spatie/error-solutions/tree/1.0.4"
},
"funding": [
{
@ -7822,7 +7756,7 @@
"type": "github"
}
],
"time": "2024-06-27T12:22:48+00:00"
"time": "2024-06-28T13:33:04+00:00"
},
{
"name": "spatie/flare-client-php",

View File

@ -165,9 +165,7 @@ return [
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
//App\Providers\Filament\AdminPanelProvider::class,
App\Providers\RouteServiceProvider::class,
])->toArray(),

View File

@ -1,83 +0,0 @@
<?php
use Laravel\Sanctum\Sanctum;
return [
/*
|--------------------------------------------------------------------------
| Stateful Domains
|--------------------------------------------------------------------------
|
| Requests from the following domains / hosts will receive stateful API
| authentication cookies. Typically, these should include your local
| and production domains which access your API via a frontend SPA.
|
*/
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
'%s%s',
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
Sanctum::currentApplicationUrlWithPort()
))),
/*
|--------------------------------------------------------------------------
| Sanctum Guards
|--------------------------------------------------------------------------
|
| This array contains the authentication guards that will be checked when
| Sanctum is trying to authenticate a request. If none of these guards
| are able to authenticate the request, Sanctum will use the bearer
| token that's present on an incoming request for authentication.
|
*/
'guard' => ['web'],
/*
|--------------------------------------------------------------------------
| Expiration Minutes
|--------------------------------------------------------------------------
|
| This value controls the number of minutes until an issued token will be
| considered expired. This will override any values set in the token's
| "expires_at" attribute, but first-party sessions are not affected.
|
*/
'expiration' => null,
/*
|--------------------------------------------------------------------------
| Token Prefix
|--------------------------------------------------------------------------
|
| Sanctum can prefix new tokens in order to take advantage of numerous
| security scanning initiatives maintained by open source platforms
| that notify developers if they commit tokens into repositories.
|
| See: https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning
|
*/
'token_prefix' => env('SANCTUM_TOKEN_PREFIX', ''),
/*
|--------------------------------------------------------------------------
| Sanctum Middleware
|--------------------------------------------------------------------------
|
| When authenticating your first-party SPA with Sanctum you may need to
| customize some of the middleware Sanctum uses while processing the
| request. You may change the middleware listed below as required.
|
*/
'middleware' => [
'authenticate_session' => Laravel\Sanctum\Http\Middleware\AuthenticateSession::class,
'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
],
];