This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function addVideo(Request $request) { | |
$video = $request->file('video'); | |
$user = $request->user(); | |
$mainFileName = Str::random(6) . now()->timestamp . "." . $video->getClientOriginalExtension(); | |
$previewFileName = Str::random(6) . now()->timestamp . ".mp4"; | |
$mainFilePath = 'uploads/' . $user->uid .'/video/'. $mainFileName; | |
$previewFilePath = 'uploads/' . $user->uid .'/video/'. $previewFileName; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function signUp(Request $request) | |
{ | |
$username = $request->input('username'); | |
$name = $request->input('name'); | |
$email = $request->input('email'); | |
$phone = $request->input('phone'); | |
$password = $request->input('password'); | |
//inputs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use Carbon\Carbon; | |
use Closure; | |
use Illuminate\Support\Facades\Cache; | |
class Idempotency | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function boot() | |
{ | |
$this->registerPolicies(); | |
Passport::routes(); | |
Passport::tokensCan([ | |
'staff' => 'Access Admin Backend', | |
'customer' => 'Access Customer App', | |
'role' => 'Description for role', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function signIn(Request $request) | |
{ | |
$email = $request->input('email'); | |
$password = $request->input('password'); | |
$rules = [ | |
'email' => 'required|email:rfc,dns|max:255', | |
'password' => ['required'], | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
'guards' => [ | |
'web' => [ | |
'driver' => 'session', | |
'provider' => 'users', | |
], | |
'api' => [ | |
'driver' => 'passport', | |
'provider' => 'users', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
'providers' => [ | |
'customer' => [ | |
'driver' => 'eloquent', | |
'model' => App\customer::class, | |
], | |
'staff' => [ | |
'driver' => 'eloquent', | |
'model' => App\staff::class, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\Foundation\Auth\User as Authenticatable; | |
use Illuminate\Notifications\Notifiable; | |
use Illuminate\Support\Carbon; | |
use Illuminate\Support\Facades\Storage; | |
use Laravel\Passport\HasApiTokens; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function dashboard(Request $request) { | |
$customer = $request->user(); | |
// the full object of the customer as containted in the able would | |
// be available now | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Auth\AuthenticationException; | |
class CheckForAllScopes | |
{ |
NewerOlder