Skip to content

Instantly share code, notes, and snippets.

View shanerbaner82's full-sized avatar
🎯
Focusing

Shane Rosenthal shanerbaner82

🎯
Focusing
View GitHub Profile

Use AWS S3 for Laravel Storage | 2023 Version

I know, I know! I was there too, trust me. The AWS dashboard can be intimidating, confusing, seemingly overkill for what you are trying to do, and compared to other popular resources out there it is easy to completely dismiss AWS altogether and roll with something else.

However, there is a reason that some of the BIGGEST companies in the world use AWS for their web services. Companies like Twitch, LinkedIn, Facebook and even all of those chill time movies are streamed from Netflix through AWS. It is for good reason.

I cannot teach the entirety of AWS in a single article, but I can demystify the dashboard just a bit by showing you how to navigate through and ultimately implement S3 buckets in your Laravel apps.

## Bucket Policy
```
{
"Version": "2012-10-17",
"Id": "Policy1692807538499",
"Statement": [
{
"Sid": "Stmt1692807537432",
"Effect": "Allow",
"Principal": "*",
recipejs pa native:build mac
Build NativePHP app…
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
INFO Discovering packages.
> NativePHP@1.0.0 build:mac
> cross-env npm run build:mac-arm && cross-env npm run build:mac-x86
> NativePHP@1.0.0 build:mac-arm
> cross-env node php.js --arm64 && cross-env npm run build && cross-env electron-builder -p never --mac --config --arm64
Binary Source: /Users/sdr/Code/justdailytodos/vendor/nativephp/php-bin/bin/mac/arm64
Binary Filename: php
Copying PHP file(s) from /Users/sdr/Code/justdailytodos/vendor/nativephp/php-bin/bin/mac/arm64 to /Users/sdr/Code/justdailytodos/vendor/nativephp/electron/resources/js/resources/php
sdr@shanes-mbp [19:00:42] [~/Code/justdailytodos]
-> % pa native:install
Publishing NativePHP Service Provider...
Would you like to install the NativePHP NPM dependencies? (yes/no) [yes]:
>
Fetching latest dependencies…
> NativePHP@1.0.0 postinstall

NativePHP: The Future of App Development is Here, and It's Mind-Blowing!

Unless you have been living under a rock for the last couple of weeks, you are probably already familiar with NativePHP. NativePHP, created by Marcel Pociot at BeyondCode, allows us Laravel Devs to leverage ALL the working knowledge we already have with Laravel to build native Mac, Windows, and Linux applications.

I recently saw Christopher Rumpel working on an app that let's you store the timezones of your friends so you can see what time it is at a glance. Follow along with me as we put together a Mac MenuBar application to know the local time of each member of your team.

@shanerbaner82
shanerbaner82 / Website.php
Created February 11, 2023 20:48
NOT MY CODE
<?php
namespace App\Models;
//use App\Http\Helpers\WebsiteHelper;
//use App\Services\GetChargeBeeSubscriptionsService;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
class Website extends Model
<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://COMPANY.org/WtsmWS/ServiceRequests" xmlns:s1="http://COMPANY.com/WtsmWS/Common" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://COMPANY.org/WtsmWS/ServiceRequests">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://COMPANY.org/WtsmWS/ServiceRequests">
<s:import namespace="http://COMPANY.com/WtsmWS/Common"/>
<s:element name="CreateServiceRequest">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="NewServiceRequestInfo" type="tns:NewServiceRequest"/>
const palettes = [
["#3761d4","#f1ece7","#e1749a","#c74b51","#ebcc45","#5d8edf","#2f3379","#6f782b"],
["#577b88","#dd7c48","#f1dabf","#614379"],
["#d7d6d5","#bb4b41","#5a433d","#448db8"],
]
let size = 1000;
@shanerbaner82
shanerbaner82 / MintFunction
Created August 31, 2021 17:36
Mint w Gas
async mint(context, amount) {
const mintValue = web3.utils.toWei((amount * context.state.contractData.nftPrice).toString(), 'ether');
const contract = new web3.eth.Contract(ABI, process.env.CONTRACT_ADDRESS);
try {
const value = web3.utils.toHex(mintValue);
const data = contract.methods.mintFunction(amount).encodeABI();
const transactionParameters = {