Revision 1673 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed
<?phpnamespace App\Http\Controllers;use App\Models\PriceAgency;class PriceAgencyController extends Controller{//public function download( string $filename ): void{$priceAgency = PriceAgency::where( "csv_url", "https://www." . env( "shop" ) . "/preisagentur/" . $filename )->firstOrFail();$priceAgency->last_access_at = date( "Y-m-d H:i:s" );$priceAgency->last_access_by = $_SERVER["REMOTE_ADDR"];header( 'Content-Type: text/plain' );header( 'Content-Length: ' . @filesize( "preisagentur/$filename" ) );header( 'Content-Disposition: attachment; filename=' . $filename );header( 'Expires: 0' );readfile( storage_path( "/" ) . $filename );$priceAgency->save();}}