mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
link
This commit is contained in:
@@ -136,7 +136,7 @@ class BookCaseTable extends DataTableComponent
|
||||
$this->validate([
|
||||
'orangepill.amount' => 'required|numeric',
|
||||
'orangepill.date' => 'required|date',
|
||||
'photo' => 'image|max:4096', // 4MB Max
|
||||
'photo' => 'image|max:8192', // 8MB Max
|
||||
]);
|
||||
$orangePill = OrangePill::create([
|
||||
'user_id' => auth()->id(),
|
||||
|
||||
14
app/Models/TwitterAccount.php
Normal file
14
app/Models/TwitterAccount.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class TwitterAccount extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
protected $casts = [
|
||||
'data' => 'array',
|
||||
];
|
||||
}
|
||||
@@ -22,6 +22,7 @@
|
||||
"laravel/jetstream": "^2.12",
|
||||
"laravel/nova": "~4.0",
|
||||
"laravel/sanctum": "^3.0",
|
||||
"laravel/socialite": "^5.5",
|
||||
"laravel/tinker": "^2.7",
|
||||
"livewire/livewire": "^2.5",
|
||||
"nova/start": "*",
|
||||
|
||||
681
composer.lock
generated
681
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -31,4 +31,12 @@ return [
|
||||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||
],
|
||||
|
||||
'twitter' => [
|
||||
'oauth' => 2,
|
||||
'client_id' => env('TWITTER_CLIENT_ID'),
|
||||
'client_secret' => env('TWITTER_CLIENT_SECRET'),
|
||||
'redirect' => env('TWITTER_REDIRECT_URI'),
|
||||
],
|
||||
|
||||
|
||||
];
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('twitter_accounts', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('twitter_id');
|
||||
$table->string('nickname');
|
||||
$table->string('token');
|
||||
$table->unsignedInteger('expires_in');
|
||||
$table->json('data');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('twitter_accounts');
|
||||
}
|
||||
};
|
||||
2
public/vendor/nova/app.js
vendored
2
public/vendor/nova/app.js
vendored
File diff suppressed because one or more lines are too long
2
public/vendor/nova/app.js.map
vendored
2
public/vendor/nova/app.js.map
vendored
File diff suppressed because one or more lines are too long
2
public/vendor/nova/mix-manifest.json
vendored
2
public/vendor/nova/mix-manifest.json
vendored
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"/app.js": "/app.js?id=8d0031f02505a357ea9665ac8501757d",
|
||||
"/app.js": "/app.js?id=ff630f0ed0a9f9a312a5fdc986bcfbc9",
|
||||
"/manifest.js": "/manifest.js?id=d75058ce2144a4049857d3ff9e02de1e",
|
||||
"/app.css": "/app.css?id=72ecd473fa8870767c692de160ca79ed",
|
||||
"/vendor.js": "/vendor.js?id=de86bde8857e857b607852d11627d8e4",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Laravel\Socialite\Facades\Socialite;
|
||||
|
||||
Route::get('/', \App\Http\Livewire\Frontend\Welcome::class)
|
||||
->name('welcome');
|
||||
@@ -9,6 +10,33 @@ Route::get('/auth/ln', \App\Http\Livewire\Auth\LNUrlAuth::class)
|
||||
->name('auth.ln')
|
||||
->middleware('guest');
|
||||
|
||||
Route::get('/auth/twitter', function () {
|
||||
return Socialite::driver('twitter')
|
||||
->scopes([
|
||||
'tweet.write',
|
||||
])
|
||||
->redirect();
|
||||
})
|
||||
->name('auth.twitter.redirect');
|
||||
|
||||
Route::get('/auth/twitter/callback', function () {
|
||||
$twitterUser = Socialite::driver('twitter')
|
||||
->user();
|
||||
$twitterAccount = \App\Models\TwitterAccount::updateOrCreate([
|
||||
'twitter_id' => $twitterUser->id,
|
||||
], [
|
||||
'twitter_id' => $twitterUser->id,
|
||||
'nickname' => $twitterUser->nickname,
|
||||
'token' => $twitterUser->token,
|
||||
'expires_in' => $twitterUser->expiresIn,
|
||||
'data' => [],
|
||||
]);
|
||||
|
||||
echo 'Twitter account updated. We can now tweet on: '.$twitterUser->name;
|
||||
die;
|
||||
})
|
||||
->name('auth.twitter');
|
||||
|
||||
/*
|
||||
* School
|
||||
* */
|
||||
|
||||
Reference in New Issue
Block a user