Skip to main content

Posts

Showing posts from May, 2018

Socialite use

https://scotch.io/tutorials/laravel-social-authentication-with-socialite Users migration: Schema:: create ( 'users' , function (Blueprint $table ) { $table ->increments( 'id' ); $table ->string( 'name' ); $table ->string( 'email' )->unique(); $table ->string( 'password' )->nullable(); $table ->string( 'provider_id' )->nullable(); $table ->string( 'provider' )->nullable(); $table ->rememberToken(); $table ->timestamps(); }); app.php: aliasis: 'Socialite' => Laravel\Socialite\Facades\Socialite:: class , Providers: Laravel\Socialite\SocialiteServiceProvider:: class , login Controller: <?php namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\User; use Illuminate\Foundation\Auth\AuthenticatesUsers; use Illuminate\Support\Facades\Auth; use Laravel\Socialite\Facades\Socialite; class LoginCon

Send Sms Using Sparrowsms api

web.php Route:: get ( '/sendsms' , 'SmsController@sendSms' )->name( 'sendsms' ); //loading sms form Route:: post ( '/sendmessage' , 'SmsController@sendMessage' )->name( 'sendmessage' ); //submitting sms form data Controller SmsController <?php namespace App\Http\Controllers; use Illuminate\Http\Request; class SmsController extends Controller { public function sendSms(){ return view( 'sendsms' ); } public function sendMessage(Request $request ) { $api_url = "http://api.sparrowsms.com/v2/sms/?" . http_build_query( array ( 'token' => 'e84KLAlrt4BfsBhlL13E' , 'from' => 'DEMO' , 'to' => $request ->input( 'phone_number' ), 'text' => $request ->input( 'message' ))); $response = file_get_contents( $api_url );