Nana-Odai

Nana-Odai

Member Since 8 Months Ago

Experience Points
1,310
Total
Experience

3,690 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
3
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 1
1,310 XP
Jan
22
6 hours ago
Activity icon

Started a new Conversation Fingerprint Bio-metric Attendance System In Laravel

Is there any fingerprint biometric device that can be integrated into laravel

Jan
20
2 days ago
Activity icon

Replied to 401 Unauthorized When Creating Password Grant Tokens With Passport

I checked in the DB and realized that there is field password_client which was set to 0. Now am I using the vue dashboard provided to generate a client. I changed the password_client value from 0 to 1 and it worked. So how do I set the value to 1 when I am using the dashboard to create a client.?

Jan
16
6 days ago
Activity icon

Started a new Conversation 401 Unauthorized When Creating Password Grant Tokens With Passport

I have created an api with passport and want to use password grant tokens because it is more of application to application interactions. But i get below error when i try to access it.

GuzzleHttp\Exception\ClientException
Client error: `POST http://127.0.0.1:8000/oauth/token` resulted in a `401 Unauthorized` response: {"error":"invalid_client","error_description":"Client authentication failed","message":"Client authentication failed"}

my route

Route::get('/get_token_by_password', function (Request $request) {

    $http = new GuzzleHttp\Client;

    $response = $http->post('http://127.0.0.1:8000/oauth/token', [
    'form_params' => [
        'grant_type' => 'password',
        'client_id' => 9,
        'client_secret' => '4tt6SaYCxh1SZ8W4653fsOH725lul3aVZmLSi2EV',
        'username' => '[email protected]',
        'password' => '123456789',
        'scope' => '*',
    ],
]);

return json_decode((string) $response->getBody(), true);

})->name('get_token_by_password');

What might i be doing wrong?

Also, how do use postman to get the token.

Dec
24
4 weeks ago
Activity icon

Replied to Changing Laravel Auth From Login To Register

i have tried that but it's not working

Activity icon

Started a new Conversation Changing Laravel Auth From Login To Register

when using the default laravel auth, on routes, like below, you are redirected to the login page if you are not logged in. is there a way to change it the signup page instead of the login page.

// auth users
Route::Group(['middleware' => ['auth'], 'namespace' => 'Users'], function(){
    // other routes
    // payment
    Route::get('payment_plans', '[email protected]_plans')->name('payment_plans');
    // populateBilling
    Route::post('populateBilling', '[email protected]')->name('populateBilling');
});
Dec
20
1 month ago
Dec
19
1 month ago
Activity icon

Replied to Query By Month And Year

What is the request returning.? in which format of month? Note, the start_day format must be same as the year. so if you have start_day as 2019 in your db, then your $request->year must be of type year as 2019. same as the months.

Activity icon

Replied to Users Role And User Permission Migration Error

The issue is with your foreign key formation. Change it as below

$table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
Activity icon

Started a new Conversation Writing A Middleware To Check If A User As Subscribed

I am writing a middleware to check if a user

  1. has subscribed to a plan and complete billing plan then after login, continue to dashboard
  2. has subscribed but have not complete the billing then, redirect to payment plan page.

I have attached two fields to my user table membership_id and ``` membership_status``

if a user create an account, a membership id is updated and after payment, status is set to 1.


//routes
/ auth users
Route::Group(['middleware' => ['auth', 'membershipStatus'], 'namespace' => 'Users'], function(){
    // dashboard
    Route::get('dashboard', '[email protected]')->name('dashboard');

    // payment
    Route::get('payment_plans', '[email protected]_plans')->name('payment_plans');
});

//my middleware

public function handle($request, Closure $next)
    {
        $path = $request->path();
        if ($path !== 'payment_plans') {

            if (\Auth::check()) {
              if(auth()->user()->membership_id != 0 && auth()->user()->plan_status == 1){
                return redirect('dashboard');
            }elseif(auth()->user()->membership_id != 0 && auth()->user()->plan_status == 0){
                return redirect('payment_plans')->with('info','Complete your subscription');
            }
        }
    }
    return $next($request);

}




Activity icon

Started a new Conversation Better Way For File Download

when click on the link the file is downloaded or opened in a new tab. But the path shows in the address bar. Is there a better way to prevent the address from showing

<a href="{{getDocument($document->filename)}}"  target="_blank">
</a>

the path. this is what i don't want to show http://127.0.0.1:8000/storage/documents/Services.docx

Dec
18
1 month ago
Dec
17
1 month ago
Activity icon

Replied to How To Validate Images, Videos, Audios, Pdfs, Word, Excell, And Powerpoint Documents All From One Input File

I am now getting this error when i upload a any file

The file must be a file.

The file must be a file of type: jpeg, png, jpg, zip, pdf, ppt, pptx, xlx, xlsx, docx, doc, gif, webm, mp4, mpeg.

I am getting below error also if i make the validation only required when on production server. ie 'file' => 'required' Unable to guess the MIME type as no guessers are available (have you enable the php_fileinfo extension?).

Activity icon

Replied to How To Validate Images, Videos, Audios, Pdfs, Word, Excell, And Powerpoint Documents All From One Input File

if i upload any file it fails. but the mime is listed in the validation

Activity icon

Replied to How To Validate Images, Videos, Audios, Pdfs, Word, Excell, And Powerpoint Documents All From One Input File

i have tried your solution but not working. what does video-work-upload-form mean or do?

Activity icon

Started a new Conversation How To Validate Images, Videos, Audios, Pdfs, Word, Excell, And Powerpoint Documents All From One Input File

i want to validate every uploaded file. That is images, videos, audios, pdfs, word, excell, and powerpoint documents all from one input file but getting below error

The file must be a file of type: jpeg, png, PNG, jpg, zip, pdf, ppt, pptx, xlx, xlsx, docx, doc, gif, webm, mp4, mpeg.

This is the validation

'file' => 'required|mimes:jpeg,png,jpg,zip,pdf,ppt, pptx, xlx, xlsx,docx,doc,gif,webm,mp4,mpeg',

Dec
05
1 month ago
Activity icon

Replied to Redirecting To Intended Url

There are other routes as well which the user needs to be authenticated first

Route::Group(['middleware' => 'auth', 'namespace' => 'Users'], function(){
    // dasboard
    Route::get('dashboard', '[email protected]')->name('dashboard');

    // payment
    Route::get('payment_plans', '[email protected]_plans')->name('payment_plans');

    // submit payment
    Route::post('submitPayment', '[email protected]')->name('submitPayment');
}); 
Activity icon

Replied to Redirecting To Intended Url

If you check the routes i provided above. If a user want to access for example payment_plans, the user must be authenticated first. so if you try to access payment_plans, you will be redirected to the login page, then you login or register before you are redirected back to payment_plans again. The login works. But after registration, you are redirected to the protected $redirectTo = '/home'; in the register controller. but i want the user to be redirected to payment_plans.

Dec
04
1 month ago
Activity icon

Replied to Redirecting To Intended Url

I don't want it to be change to the dashboard but any other routes which the user must be authenticated before can access that page.

Activity icon

Started a new Conversation Redirecting To Intended Url

I want to redirect a user to the intended URL after registration. i Have tried several solution online. stack overflow, laracast and other sites, but still not getting the desired result. The login works.

My routes

Route::Group(['middleware' => 'auth', 'namespace' => 'Users'], function(){
    // payment
    Route::get('dashboard', '[email protected]')->name('dashboard');

    // payment
    Route::get('payment_plans', '[email protected]_plans')->name('payment_plans');

    // payment
    Route::post('submitPayment', '[email protected]')->name('submitPayment');
});

The user is redirected to any of the above routes after login, but after registration, it does not redirect the user to the routes above but to this in the controller protected $redirectTo = '/home';

Nov
28
1 month ago
Activity icon

Started a new Conversation Converting The Following To Loop

i'am creating a map using leaflet

I have been able to to get this locations on the map. but i want to query the details, the latitudes, and longitudes and popup mesage from the database. which i will loop through. how do i go about it

var littleton = L.marker([39.61, -105.02]).bindPopup('This is Littleton, CO.'),
        denver    = L.marker([39.74, -104.99]).bindPopup('This is Denver, CO.'),
        aurora    = L.marker([39.73, -104.8]).bindPopup('This is Aurora, CO.'),
        golden    = L.marker([39.77, -105.23]).bindPopup('This is Golden, CO.');

        var cities = L.layerGroup([littleton, denver, golden, aurora]);

The cities is called in this map

    var map = L.map('mapid', {
            center: [39.73, -104.99],
            zoom: 10,
            layers: [grayscale, cities]
        });
Activity icon

Replied to Renaming Laravel Default Login Route Name "login"

The login is still working, which i think should throw error if set to false;

I've been able to change it this way

Auth::routes(['login' => false, 'register' => false]);

Route::get('user_register')->name('register')->uses('Auth\[email protected]');

Route::get('user_login')->name('login')->uses('Auth\[email protected]');

But that of the register route works fine with the new define route user_register but the both login and user_login show the login form.

Activity icon

Replied to Renaming Laravel Default Login Route Name "login"

I want to make use of the other routes. so what happens if i Auth::routes(); is removed. because am getting Route [register] not defined. And also i want to implement must verify Auth::routes(['verify' => true]);

Activity icon

Started a new Conversation Renaming Laravel Default Login Route Name "login"

I want to rename the default name of login route which is "login" to something like "user_login". How do i go about it. Thanks

Nov
05
2 months ago
Activity icon

Started a new Conversation How To Create The Following Shape In Css With Clip-path Or Any Other Way

I am trying to achieve this shape but not being able to get the desired result. I am using it in a bootstrap carousel

link to image

https://i.stack.imgur.com/DraDX.png

Below is what i've done so far.

html code <div>hello</div>

css code

  height:300px;
  width:350px;
  background: #414141;
   clip-path: polygon(0 10%, 100% 23%, 100% 90%, 0% 100%);
 filter: drop-shadow(30px 10px 4px #2ec);
}```
Oct
28
2 months ago
Activity icon

Started a new Conversation How Do I Use HTTP_Request2 In Class I Have Created In App

I have create a class in 'App\Helpers\tokens which i want to use HTTP_Request2, but i am gettting below error,

Class 'App\Helpers\HTTP_Request2' not found

what do i need to do. Below is my code

<?php 
use \App\Helpers\HTTP_Request2;
namespace App\Helpers;

Class Tokens{

    public static function tokens(){
        
        require_once 'HTTP/Request2.php';

        $request = new \Http_Request2('https://sandbox.momodeveloper.mtn.com/collection/token/');
        $url = $request->getUrl();
Activity icon

Replied to How Do I Use HTTP_Request2 In Laravel 5?

Have you gotten solution on how you included the request2. I am facing same issue.

Oct
16
3 months ago
Activity icon

Started a new Conversation Search Box With Rounded Corners And Buttons

I want to achieve the result in the image below but i am not getting the desired result. Below is my code

<div class="row no-gutters mt-3 align-items-center">
    <div class="col col-md-4">
        <input class="form-control border-secondary rounded-pill " type="search"  id="example-search-input2" style="width: 100%">
    </div>
    <div class="col-auto">
        <button class="btn btn-primary btn-outline-light text-white border-0 rounded-pill ml-n5" type="button" >
        search
        </button>
    </div>
</div>

https://i.stack.imgur.com/qYpe9.png

Aug
24
4 months ago
Activity icon

Replied to Sending More Than 10,000 Sms

Hello, how were you able to implement the sms with jobs. need some help on this. doing similer.