Question: Is there a function or something in laravel which I can use to make first letter uppercase in breadcrumbs? 

This is what I'm using right now but in my links and routes are all lowercase letters and if I go and try to update all will be very time consuming..

```
<ul class="breadcrumb">
<li>
     <i class="glyphicon glyphicon-home"></i>
     <a href="{{ URL::to('/') }}">Home</a> /
     @for($i = 0; $i <= count(Request::segments()); $i++)
         <a href="">{{Request::segment($i)}}</a>
         @if($i < count(Request::segments()) & $i > 0)
              /
         @endif
</li>
     @endfor
</ul>

```

Or this isn't correct way of making breadcrumbs in laravel 4.2?

Answer: 
This javascript snippet is a working example of how to do this. You can try it and tweak it: <https://jsfiddle.net/s3egg5h7/43/>

As pointed out, a Javascript-only solution requires a 3rd-party service, in this case <https://oauth.io>.

Even if you do not want to use the 3rd-party service, the snippet is useful since you do not have to write any code to test out Twitter APIs to see they return what you need

It is pretty short:

```
$('#twitter-button').on('click', function() {
    // Initialize with your OAuth.io app public key
    OAuth.initialize('OAUTH_IO_KEY');
    // Use popup for OAuth
    OAuth.popup('twitter').then(twitter => {
        console.log('twitter:', twitter);
        // Retrieves user data from OAuth provider by using #get() and
        // OAuth provider url    
        twitter.get('/1.1/account/verify_credentials.json?include_email=true').then(data => {
            console.log('self data:', data);
        })    
    });
})

```

It requires a few external references, e.g., bootstrap css, oauthio javascript open-source library, etc.

I think using a 3rd-party service may make sense since it hides all the inconsistencies in the OAuth implementation of different providers, like Twitter, Facebook, etc.

I did not create this code so for attribution purposes, please refer to: <https://coderwall.com/p/t46-ta/javascript-twitter-social-login-button-for-oauth>
If you check the twitter's api documentation, you can see how to do the login.

I think your question is how insert a plugin to login similar than facebook but I think they don't did any library.

When the user clicks the loggin button you must send a post request to twitter to get the oauth\_token:
Example: POST request to "api.twitter.com/oauth/request\_token"

and then, twitter provides you the oauth\_token and the oauth\_token\_secret (private).

Once you did this step you must to redirect the user to twitter.
Example: GET request to "api.twitter.com/oauth/authenticate?oauth\_token=YOUR\_OAUTH\_TOKEN\_GIVEN\_IN\_STEP\_1"

If everything has gone well twitter response you with the oauth\_token and a verifier oauth token.

Let's set up the last step!

Send a post request to twitter api endpoint with the verifier oauth token provided in the response of step 2.
Example: POST request to "api.twitter.com/oauth/access\_token" sending the verifier oauth token as post parameter.

And then twitter response with a secret token and the user token, you can save it and feel free to use it in any twitter endpoint.

Login documentation: <https://dev.twitter.com/web/sign-in/implementing>
Browser auth flow: <https://dev.twitter.com/web/sign-in/desktop-browser>

Regards!