Sabonzy

Sabonzy

Member Since 3 Years Ago

Sagakope

Experience Points 27,120
Experience Level 6

2,880 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 244
Lessons
Completed
Best Reply Awards 2
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

10 May
1 month ago

Sabonzy left a reply on Forge Provisioned DigitalOcean Nginx 404 Not Found

it worked after point a domain to the server. am curious if i want to access the server through IP without pointing a domain it what do i have to do to get it working

07 May
1 month ago

Sabonzy left a reply on Forge Provisioned DigitalOcean Nginx 404 Not Found

@BOBBYBOUWMANN - the default site is deleted by forge when i changed the domain to emopgh.org i even deleted the whole site and added again through forge interface

Sabonzy left a reply on Forge Provisioned DigitalOcean Nginx 404 Not Found

@CLICK - yes my application is located there

Sabonzy left a reply on Forge Provisioned DigitalOcean Nginx 404 Not Found

@BOBBYBOUWMANN - it's was added through gitlab repository. during the server provision the event output for Nginx configuration showed an error so check the the error was a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/traffic.mg:5 before the config was

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name emopgh.org;
}

and i changed it to

server {
    listen 80;
    listen [::]:80;
    server_name emopgh.org;
}

and the error was resolved but i can't still access the site even with the IP address

Sabonzy started a new conversation Forge Provisioned DigitalOcean Nginx 404 Not Found

I used forge to provision a server on Digital Ocean and when i visit the IP i get 404 Not Found. i can ping the IP and also i can ssh into the server. i have even deleted the site and re added it but same result.

how can i get nginx to serve my site

nginx -t output is 

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
nginx config

# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/emopgh.org/before/*;

server {
    listen 80;
    listen [::]:80;
    server_name emopgh.org;
    root /home/forge/emopgh.org/public;

    # FORGE SSL (DO NOT REMOVE!)
    # ssl_certificate;
    # ssl_certificate_key;

    ssl_protocols TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
    ssl_prefer_server_ciphers on;
    ssl_dhparam /etc/nginx/dhparams.pem;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";

    index index.html index.htm index.php;

    charset utf-8;

    # FORGE CONFIG (DO NOT REMOVE!)
    include forge-conf/emopgh.org/server/*;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log  /var/log/nginx/emopgh.org-error.log error;

    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}

# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/emopgh.org/after/*;

nginx status is

● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2019-05-07 14:57:59 UTC; 22min ago
     Docs: man:nginx(8)
  Process: 27662 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, s
  Process: 28592 ExecReload=/usr/sbin/nginx -g daemon on; master_process on; -s reload (code=exited, status=0/SUCCESS)
  Process: 27674 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 27663 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
 Main PID: 27678 (nginx)
    Tasks: 2 (limit: 2362)
   CGroup: /system.slice/nginx.service
           ├─27678 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           └─28593 nginx: worker process

May 07 14:57:58 emop-server systemd[1]: Stopped A high performance web server and a reverse proxy server.
May 07 14:57:58 emop-server systemd[1]: Starting A high performance web server and a reverse proxy server...
May 07 14:57:58 emop-server systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
May 07 14:57:59 emop-server systemd[1]: Started A high performance web server and a reverse proxy server.
May 07 14:57:59 emop-server systemd[1]: Reloading A high performance web server and a reverse proxy server.
May 07 14:57:59 emop-server systemd[1]: Reloaded A high performance web server and a reverse proxy server.
May 07 14:58:17 emop-server systemd[1]: Reloading A high performance web server and a reverse proxy server.
May 07 14:58:17 emop-server systemd[1]: Reloaded A high performance web server and a reverse proxy server.

thanks in advance

12 Apr
2 months ago

Sabonzy left a reply on Is It Possible To Submit An Axios Post With An Image(formData) And Variables(data) In Vue

You have to add the relevant data to the formData.

methods: {
            onLoad(avatar) {
                this.avatar = avatar.src;
                this.persist(avatar.file);
            },

            persist(avatar) {
                let data = new FormData();

                data.append('avatar', avatar)
                data.append('organizationName',this.organizationName)
// add all relevant ones here before posting to the backend
                axios.post(`/user`, data)
                    .then(() => flash('Avatar uploaded!'));``

Sabonzy left a reply on How To Use Queries On 2 Relationships In Laravel

If you want only the query the matches the relationship be returned then use the whereHas


$posts = $data = Property::with('dates' , details')-> whereHas('dates', function ($query) {
    $query->where('date', 'like', '%4/11/2019%');
})->orWhereHas(details' => function ($query) {
          $query->where('city', 'like', 'london')->get() my
10 Apr
2 months ago

Sabonzy left a reply on Trying To Get A Property 'name' Of Non-object

the problem is from here

 public function role() {
        return $this-> belongsTo ('App\Role');
    } 

if the foreign key is not user_id then you have to provide it as the second argument.

i will change the relationship to looks this this if the user can have many roles

 public function role() {
        return $this-> hasMany('App\Role');
    } 

or this only for single role

 public function role() {
        return $this-> hasOne('App\Role');
    } 

for hasMany relationship $this->role returns a collection change to this instead

 public function isAdmin() {
return $this->role->contains('Admin')
           }

Sabonzy left a reply on How To Conditionally Chain Queue Jobs

Current am firing an event and conditionally pushing event listeners to queue as describe here by Mohamed.

event(new ExportCompletedEvent($this->user, $pathToFile, $fileToMergeInto,
                        $this->to->equalTo(Arr::last($days->last()))));

and in the Event Listener check whether it should be queued or not

 public function shouldQueue($event)
        {
            return $event->queue;
        }

Sabonzy left a reply on How To Conditionally Chain Queue Jobs

@BRAUNSON - thanks for your response. Inside ProcessDownload job multiple instance of SmpWorkbook job will run depending on the chunk size, queuing the job before check whether the job should be run might end up filling the queue with unnecessary jobs and i need all instances of SmpWorkbook to finish before any related job like MergeWorkSheets($data) or NotifyUserOfCompletedExport($data) can run

09 Apr
2 months ago

Sabonzy left a reply on Import Csv File Without Header Lines How It Work?

@VANDAN - this only apply to excel 2.1 but with excel 3.1 you have to implement the WithHeadings and WithMapping concerns. check the docs

Sabonzy started a new conversation How To Conditionally Chain Queue Jobs

I am using laravel-excel to export data to excel, it can take quiet a while to finish and sometimes timeout when the data is very large. I decided to break the export into smaller units and combine them later. The user needs to be notified when the whole process is complete. the problem is that the user gets notified upon every completed piece of the process. for instance if i break the export process into five pieces the user will be notified five times and that's not what i want, so i created another job and chained the user notification on but the problem with this is that the user get notified before the exports get completed.

Is There a way i can conditionally chain a job so they can run sequentially.

note am using queues for the process

  $pathToFile = Str::slug(auth()->user()->name).'/'.md5(collect(request()->query())->flatten());
            $masterExcelFileName = Str::slug(request()->user()->name.' '.md5(collect(request()->query())->flatten())).'.xlsx';
            $this->dispatch(
                (new  ProcessDownload($this->getGroup(), $this->getSubGroup(), $this->getDateFrom(),
                    $this->getDateTo(), request('system_name'), $pathToFile, $masterExcelFileName)
                )->chain([
                    new NotifyUserOfCompletedExport(request()->user(), $pathToFile, $masterExcelFileName),
                ])->allOnQueue('exports')
            );

ProcessDownload class

 public function handle()
        {

            collect($this->datePeriod())->chunk(7)->each(function (Collection $week) {
                $days = $week->map(function ($day) {
                    return $this->dayTimeRange($day);
                });
                $filename = Str::slug(sprintf('%s %s %s %s %s',
                        $week->first()->format('M j Y'),
                        'to',
                        $week->last()->format('M j Y'),
                        $this->group,
                        $this->subGroup)).'.xlsx';

                (new SmpWorkbookExport(
                    $this->group,
                    $this->subGroup,
                    $this->name,
                    $days
                ))->queue("$this->pathToFile/$filename", 'public', Excel::XLSX)
                    ->chain([
                        new  MergeWorkSheets($this->pathToFile,$filename,$this->masterExcelFileName)
                    ])
                    ->allOnQueue('exports');
            });

Sabonzy left a reply on Getting A Null When Accessing A Relation

the second argument of the hasMany is name of theforeignKey column and if the primary key on the parent is not id then you to provide that as the third argument

08 Apr
2 months ago

Sabonzy left a reply on Import Csv File Without Header Lines How It Work?

using the users table as an example you can format the data to include the headers.

 $users = \App\User::all()->map(function ($$user) {
                return [
                    'NAME'          => $user->name,
                    'EMAIL'          =>$user->email
                ];
            });



Excel::create('Filename', function($excel) {

    $excel->sheet('Sheetname', function($sheet) {

        $sheet->fromArray($users);

    });

})->export('xls');

Sabonzy left a reply on Argument 1 Passed To Illuminate\Database\Grammar::parameterize() Must Be Of The Type Array, Object Given Always Saying On Create With Ajax

the product_id can not be an array. either you change before the ajax call or change it in the controller

Illuminate\Support\Arr::first(implode(',',$request->product_id)

Sabonzy left a reply on Argument 1 Passed To Illuminate\Database\Grammar::parameterize() Must Be Of The Type Array, Object Given Always Saying On Create With Ajax

the variable assigned to the request data $question = $request->question; is the same the one used for the eloquent model $question = new Question; use this instead

public function saveQuestion(Request $request)
    {
        
        $question   = new Question;

        $question->product_id = $request->product_id;
        $question->question   = $request->question;
        $question->save();
       
        return response()->json(['success' => 'question saved ']);
  }  

it also help reduced your temporary variables

Sabonzy left a reply on Import Csv File Without Header Lines How It Work?

change the startRow in the excel.php in the config to match the row your data starts

'import'     => [
  
        |--------------------------------------------------------------------------
        | First Row with data or heading of data
        |--------------------------------------------------------------------------
        |
        | If the heading row is not the first row, or the data doesn't start
        | on the first row, here you can change the start row.
        |
        */
        'startRow'                => 1,
]

27 Mar
2 months ago

Sabonzy left a reply on Save To Laravel Polymorphic Relationship

@AZHAR_HUSSAIN - can you show the code for the relationship definition. what do you intend to achive on this line $model=new $this->model; because $model->likes() will return null.

Sabonzy left a reply on Save To Laravel Polymorphic Relationship

call first instead because pluck return Illuminate\Support\Collection and not Illuminate\Database\Eloquent\Collection so do this.

$type=ModelType::whereId($input['likeable_type'])->first(['title']);
                $this->model=$type;
                $model=new $this->model;
                $model->likes()->create([
                    'user_id'=>Auth::user()->id,
                    'likeable_id'=>$model['likeable_id']
                ]);
```
hope it solve your problem

Sabonzy left a reply on How To Deal With Deprecated Str_* Functions In Blade Templates?

yes in 5.8 the str_* has been deprecated read about it on the website.

if you still wants the old way u can create your own helpers

Sabonzy left a reply on How To Deal With Deprecated Str_* Functions In Blade Templates?

you can use this {{Illuminate\Support\Str::plural('name', 2)}}

Sabonzy left a reply on Mysql Index Key Not Provided When Not Limiting Query Result

@dirkzz currently the table have 10 columns with no relationship and about 30M records and 144 records added every minutes, i did what @tray2 suggested and an index key is selected. depending on the date range of the BETWEEN condition these take minutes to run, the query is used to generate excel workbook and each sheet representing the day. database queue is used for this. when the data is large the processing times long and the job fails. I want how i can reduces the processing time and have the jobs run successfully

26 Mar
2 months ago

Sabonzy left a reply on Mysql Index Key Not Provided When Not Limiting Query Result

@TRAY2 - depending on the time_updated range the difference between the two is significant. the table have records in millions

25 Mar
3 months ago

Sabonzy started a new conversation Mysql Index Key Not Provided When Not Limiting Query Result

I have two index group on my table called smp, when I run explain on the same query without limiting the query results, no key is selected, but a key is selected when limiting is added.

I have these two indexes:

  • smp_time_updated_group_name_sub_group_index (time_updated, group_name, sub_group)

  • smp_time_updated_group_name_sub_group_name_index (time_updated, group_name, sub_group, name)

When i run this query:

     `name`,
     `group_name`,
     `sub_group`,
     `value`,
     `units`,
     `time_updated` 
 FROM
     `smp` 
 WHERE
     `group_name` = 'System Data' 
     AND `sub_group` = 'System' 
     AND `time_updated` BETWEEN '2019-01-01 00:00:00' 
     AND '2019-02-28 08:43:00' 
     AND `name` IN ( 'System Demand', 'System Generation' ) 
 ORDER BY
     `time_updated` DESC 
     LIMIT 26
    OFFSET 0```

MySQL will select one of the possible index key.

But this query:


 ```EXPLAIN SELECT
         `name`,
         `group_name`,
         `sub_group`,
         `value`,
         `units`,
         `time_updated` 
     FROM
         `smp` 
     WHERE
         `group_name` = 'System Data' 
         AND `sub_group` = 'System' 
         AND `time_updated` BETWEEN '2019-01-01 00:00:00' 
         AND '2019-02-28 08:43:00' 
         AND `name` IN ( 'System Demand', 'System Generation' ) 
     ORDER BY
         `time_updated` DESC ```

selects none.

I expect the index key to be selected even when the results is not been limited.
14 Nov
7 months ago

Sabonzy left a reply on Nova Tool Tailwind Styles Not Correctly Shown?

add this @import url('https://cdn.jsdelivr.net/npm/tailwindcss/dist/tailwind.min.css'); to your tool.scss file which is located at nova-components/your-package-name/resources/sass

06 May
1 year ago

Sabonzy left a reply on How To Store Data In A Database Using Laravel

make sure your form have the enctype set to multipart/form-data like <form action="/action_page_binary.asp" method="post" enctype="multipart/form-data"></form> in order for the image to be sent alongside the form data.

27 Apr
1 year ago

Sabonzy left a reply on API Resource And Passing Data To Blade View

@martinbean thanks for the correction but as u can see that's what i implemented but the JSON representations of models is not being returned when it's passed to the view or when u die and dump (dd) it;

Sabonzy started a new conversation API Resource And Passing Data To Blade View

i am using the api resource to to transform the models before returning it a vue component through blade view but the data returned is not the transformed model but the raw model itself. Interestingly when the data is returned directly without passing it to the view then it will be formatted as described in the toArray method.

here is the controller:

 class PreApprovedController extends Controller
    {
        private $applicants;

        public function __construct(PersonalDetailsRepository $applicants)
        {
            $this->applicants = $applicants;
        }

        
        public function show($id)
        {

            $applicant = $this->applicants->withCriteria(
                    new WithRelations(
                        [
                            'batteries',
                            'inverters',
                            'solarPanels',
                            'bosInfo',
                            'location',
                        ]
                    ))->find($id);
          //  dd(new InspectionsResource($applicant)); this returns the raw model model not the transformed one
            // return new InspectionsResource($applicant); this returns the the transformed model

            return view('approved.inspections.create', compact('applicant'));
        }
    }

the api resource:

class InspectionsResource extends JsonResource
    {

        public function toArray($request)
        {
            return [
                "id"                    => $this->id,
                "full_name"             => $this->full_name,
                "phone_number"          => $this->phone_number,
                "identification_type"   => $this->identification_type,
                "identification_number" => $this->identification_number,
                "postal_address"        => $this->postal_address,
                "email"                 => $this->email,
                "profession"            => $this->profession,
                "company_name"          => $this->company_name,
                "company_location"      => $this->company_location,
                "location"              => new LocationsResource($this->whenLoaded('location')),
                "batteries"             => new BatteriesResource($this->whenLoaded('batteries')),
                "inverters"             => new InvertersResource($this->whenLoaded('inverters')),
                "solar_panels"          => new SolarPanelsResource($this->whenLoaded('solarPanels')),
                "bos_info"              => new BoSResource($this->whenLoaded('bosInfo')),
            ];
        }
    }

formatted data is also return when i convert it collections. how do i get the transformed data returned when getting a single model

24 Apr
1 year ago

Sabonzy left a reply on My Laravel Bootstraps Does't Work

i assume the the files are located in the bootstrap folder then the link should look like this


<link href="{{ asset('css/bootstrap/bootstrap.min.css') }}" rel="stylesheet">

<link href="{{ asset('css/bootstrap/bootstrap.theme.main.css') }}" rel="stylesheet">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->

<script src="{{ asset('js/bootstrap/bootstrap.min.js') }}"></script>

beside there is no need including both bootstrap.css and bootstrap.min.css.

i think u are better off leaving your asset in the resource/assets folder to leverage the power laravel mix

23 Apr
1 year ago

Sabonzy left a reply on Metthod On Models Returned Null When Called When Using Getter And Setter

I want to be able to assign different route name when the resource is called from another controller

Sabonzy started a new conversation Metthod On Models Returned Null When Called When Using Getter And Setter

this is the Model class

class Post extends Model{
     protected $routeName;
 
        public function setNamedRoute($route)
          {
              $this->routeName = $route;

          }

        public function getNamedRoute($params = [])
          {
        //  $this->routeName is always null
            return route($this->routeName, $params); 
          }
}

this is the controller

class PostsController extends Controller{

 private $posts;

        public function __construct(PostRepository $posts)
        {
            $this->posts = $posts;
        }

        public function index()
        {           
            $posts->setNamedRoute('posts.index');
            
            return $applicants = PostsResource::collection(
                $this->posts->withCriteria(
                    [
                        new HasRelation($comments),
                    ])->all()
            );
            
        }
   }

in the PostsResource class

 class PostsResource extends JsonResource
    {
        
        public function toArray($request)
        {
            return [
                "id"                    => $this->id,
                "full_name"             => $this->full_name,
                "phone_number"          => $this->phone_number,
                "identification_type"   => $this->identification_type,
                "identification_number" => $this->identification_number,
                "postal_address"        => $this->postal_address,
                "email"                 => $this->email,
                "profession"            => $this->profession,
                "company_name"          => $this->company_name,
                "company_location"      => $this->company_location,
                "comments"              => CommentsResource::collection($this->whenLoaded('comments')),

                "route"                 => $this->getNamedRoute(['comment' => $this->id]), // this return null all the time
            ];
        }
    }

how do i get the value assigned to the $this->routeName to be available when the method getNamedRoute() is called. i have tried it with the Accessors & Mutators and the same happens

12 Apr
1 year ago

Sabonzy started a new conversation How To Handle Database Tables With Similar Fields

| First Header | Second Header | | ------------- | ------------- | | Content Cell | Content Cell | | Content Cell | Content Cell |

26 Oct
1 year ago

Sabonzy left a reply on SQLSTATE[HY000] [1045] Access Denied For User

@RamjithAp i can login to phpmyadmin using the same credentials. i have tried all that but anything other than this DB_HOST=mysql5019.smarterasp.net throws this error SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it. (SQL: select * from `users` where `username` = ntagoe limit 1)

Sabonzy left a reply on SQLSTATE[HY000] [1045] Access Denied For User

@tomopongrac when the DB_HOST is changed to localhost the connection is refused by the server

SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it. (SQL: select * from `users` where `username` = ntagoe limit 1)

Sabonzy started a new conversation SQLSTATE[HY000] [1045] Access Denied For User

I uploaded laravel 5.5 to the server and updated the .env file with the database credentials but anytime the app tries to make connection with the database i get Access denied for user. Note: i can login to PhpMyAdmin using the same credentials. my env looks like this:

DB_CONNECTION=mysql DB_HOST=mysql5019.smarterasp.net DB_PORT=3306 DB_DATABASE=db_a2bab9_blubuk DB_USERNAME=db_a2bab9_blubuk DB_PASSWORD=db_password

Error message: SQLSTATE[HY000] [1045] Access denied for user 'db_a2bab9_blubuk'@'10.10.28.214' (using password: YES) (SQL: select * from users where username = ntagoe limit 1)