douglasakula

douglasakula

Member Since 1 Year Ago

Nairobi

Experience Points 50,920
Experience Level 11

4,080 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 389
Lessons
Completed
Best Reply Awards 17
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.

29 May
1 month ago

douglasakula left a reply on Multiple PHP In One Cpanel

I doubt its an option to run 2 different php versions on the same shared host simulataneosly. You could do it on a dedicated host where you can change which directory php uses for intepreting the website files. On a shared host its not an option to run simulataneously - its either one or the other. It would be more worthwhile to fix the wordpress issues that come with the upgrade to version 7+ as opposed to trying to keep both versions. If you have to keep 2 different versions of php - then having 2 hosting accounts is an option that can work for you as well

13 Apr
3 months ago

douglasakula left a reply on AllowOverride None + Multiple Laravel App In One Server


<Directory /home/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

Then restart the web server

26 Mar
3 months ago

douglasakula left a reply on Different Sub Domain Per Account

The DB facade should access the database in your routes file. So you can query the database using the DB::select() or any other DB method appropriate to get the variables you need. You could pick the query filter from the request url as well - am sure there is a method to pick a url segment which you can use to query the database.

Am not sure how you would do this locally on mac - but on a standard apache server - you can create domains or sub domains as virtual hosts (/etc/apache2/sites-available) - the virtual host would have a document root that points to the site. In this case all the domains or subdomains would point to one site. You could use one virtual host as well and have all the other domains or sub domains as aliases since they will be pointing to the same website. Then handle the subdomain or content to display at route level once traffic comes to the website

23 Mar
4 months ago

douglasakula left a reply on Custom-domain + Multi-tenant *with SSL*

What error message are you getting with https. Could it be that you need a multi domain certificate installed ? - which would have the different domain names that for your users

22 Mar
4 months ago

douglasakula left a reply on Different Sub Domain Per Account

You would need your routes to fetch the sub domain from the table and have routes directives having the sub domain variable to enable this as well.

20 Mar
4 months ago

douglasakula left a reply on How Do I Calculate The Sum Of A Column And Display It In A View?

You can do it at view level (Not recommended but at times an option based on use case) or do it at controller level.

At controller level assuming you have your entry model that has a totals column whose sum you need. You could do this.

$data["sum"] = Entry::get()->sum("total); // you could add results for logged in user alone as well by querying with the logged in user
return View("your.view", $data); // the sum variable would then be in your view

At view level - you could have an initial variable for sum that is set to 0. Then within the foreach loop you do

foreach($entries as $entry)
{
....
$sum += $entry->total; // you could do ifs here like if you need summation of logged in user
}

{{ $sum }} // sum after the foreach would have the summation of the totals you want

18 Mar
4 months ago

douglasakula left a reply on Check If Config Item Exists

Check this out. Am sure you will find it or some of it useful.


//If your file is called custom.php stored in config/custom.php do this.
      $customConfigsArray = config('custom');
      
      dump($customConfigsArray); // should give you an array of key value pair for all the configs in your custom config file. Even those that are null or false.
      
      $customConfigNames = array_keys($customConfigsArray);
      
      dump($customConfigNames); //should give you an array of keys present in the custom config file
      
      if(!in_array("new_config", $customConfigNames)) // if config you want not in config names from file
      {
        $new_config = DB::SELECT(); // Your query to get new config
        config(['analytics.view_id' => $new_config]); // initialize the config you want
      }

15 Mar
4 months ago

douglasakula left a reply on Feedback To My Shopping Cart Logic

That's fine and standard way most people implement. If gateway supports - you could pass in the order id or a custom field - unique order id - that you can check again once payment goes through and compare with current session or even use to update the corresponding order or payment in the database

douglasakula left a reply on Revert Domain Name Change

On installing letsencrypt - it will create its host file which has entry where the site should redirect. So if you changed domain or subdomain - you need to either edit the host file for letencrypt thats autogenerated when the certficate is installed or uninstall the certificate and reinstall it afresh.

14 Mar
4 months ago

douglasakula left a reply on View [auth.login] Not Found ? On Shared Host

You could do this in your routes file to create an endpoint you can execute

Route::get('/clear-cache', function() {
    Artisan::call('cache:clear');
});

douglasakula left a reply on View [auth.login] Not Found ? On Shared Host

You need to clear cache. Could be you have copied localhost cache as well

douglasakula left a reply on Issue Getting SSL To Work (This Site Can’t Be Reached)

Try to check the domain name here - https://www.sslshopper.com/ssl-checker.html to see if you get any ssl errors being detected

13 Mar
4 months ago

douglasakula left a reply on Issue With Git Pull On My Server

How to fix above:

  1. Git checkout the files that have changed in server so you can pull in the changes.
  2. Git stash the online changes so you can pull in new changes.
  3. Commit the changes in live server and merge them from your development branch before commiting again.

Either of the above would work. Below explains option 1

Looks like your remote files have some changes. So you can undo those changes in your remote server then pull in the new copy from your git origin.

To undo the changes in your server. Run this commands

git checkout public/app/js/app.js
git checkout resources/js/components/layouts/

10 Mar
4 months ago

douglasakula left a reply on How To Create Multiple Ip Addresses On Single Server

I mainly use AWS for this and to get multiple IP addresses for my server. I would acquire the ip addresses within AWS then associate them with the server instance or network interface.

douglasakula left a reply on What Service Do You Use For Your Application And Website Hosting?

I use AWS EC2 instance to host my web app. Flexible pricing based on need. Can be as cheap as free for the first year.

09 Mar
4 months ago

douglasakula left a reply on Whats The Difference ? View::make('index') And View('index')

Same thing functionally. view('index') uses the view facade / short form while view::make('index') is the long form beneath the hood view('index') still calls View::make('index')

25 Feb
4 months ago

douglasakula left a reply on Can Anyone Give Me Steps For Clone Project From GIT?

.... and the localhost path must be writable as well - so the project is "clonable"

douglasakula left a reply on CronJob

Could be permissions of the file / command on the remote environment.

20 Feb
5 months ago

douglasakula left a reply on Accessing Spatie Laravel Permission In Codeigniter?

Alternatively - you could have a CI Object within your laravel application. The CI object would be an instance of your codeigniter application and the bridge between Laravel and your CI application

11 Feb
5 months ago

douglasakula left a reply on Need Advice For Developing An ERP

@nalindadj @vilfago Ok that makes sense then - Was thinking SAAS - Each customer having their own database would make sense in this case.

Would the database be 1 structure or you foresee a situation where different cuustomers would require features that necessitate changes in their database ?

The way I would have preferred then is 1 database structure and features can be on/off where specific customer don't need certain features or are not paying for them - Sounds easier to maintain

Or probably modular so each module comes with a set of tables

douglasakula left a reply on Need Advice For Developing An ERP

Probably a rethink of the entity relationships and modelling in the system. A customer is an entity - or rather looks like an entity. They may be different - say customer types etc - but more tables can be added to take care of the difference. Say a customer_types table that has types such as corporate, premium,individual ...etc. On/off features would be tied to either companys / clients / customer - so you could have a features table, and a company_feature table having id,company_id,feature_id, state. where the state could be on and off.

Personally I would use 1 database and focus more on entity relationship modelling.

10 Feb
5 months ago

douglasakula left a reply on Redirect View After Download Pdf

@vinubangs

Currently the way you are doing it above isn't possible due to the nature of headers involved. Download headers and browser view page headers are different and cannot be loaded in one request simultaneously.

Unless you want to use javascript - the opposite can be possible where you redirect user to the page the initiate a download once the user has already landed on the page.

douglasakula left a reply on Laravel Server 500 Error

Check the version of php you are using or currently enabled. It needs to be 7.1+

douglasakula left a reply on Things To Learn

@icelander

Entity Relationship Modelling is a key "thing" you would need to learn as well to build a robust backend.

There are good resources online. This is an introductory of what it entails https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model

A good background in ER Modelling would translate to a solid database design and consequently models for your backend application. Laravel offers a great companion in Eloquent where you easily translate your ER Models to classes and define relationships within the classes.

douglasakula left a reply on .htaccess File Doesn't Work Properly In Laravel

Normally I would add this in my virtual host configuration file together with enabling mod_rewrite

<Directory /var/www/html>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
</Directory>

Where /var/www/html is the directory hosting my project - Am on ubuntu - but using apache2 for web server. Does such a configuration ring a bell in your setup - I think there is somewhere within apache2 settings you can enable it globally.

So AllowOverride needs to be edited on your apache2 global vhost config file

douglasakula left a reply on .htaccess File Doesn't Work Properly In Laravel

Have you setup a virtual host configuration file for the website - What url are you using on your local server ?

Are you using apache2 for the webserver btw ?

douglasakula left a reply on .htaccess File Doesn't Work Properly In Laravel

Looks to me like a mod_rewrite issue. Is it enabled on your local server ?

09 Feb
5 months ago

douglasakula left a reply on How Can I Use Laravel Auth() In My Custom Pacakge?

probably use Auth; in your package controller file

douglasakula left a reply on Laravel Authentication "standard"

If the application has been dormant for sometime - say 30 minutes. Require user to login again so you can refresh the token with a new one that you update in your headers.

I think standard practice is to refresh tokens.

douglasakula left a reply on Bus Transport System

@micheal

You need to add some javascript code on the page.

  1. Add an onchange event listener on the "from" select so that when it is changed - a custom function is called that either removes or repopulates the option on the "to" input.
  1. The custom function to be called can repopulate the "to" select with list of cities excluding the selected city in "from" above
08 Feb
5 months ago

douglasakula left a reply on MS-SQL To MySql Auto Sync

Simple sync - probably an API that provides records based on input like created_at, updated_at that are used to filter and fetch for new records in the ms sql database and save this to the mysql database.

Functionality such that users registered on the ms sql database can login to another app running laravel on mysql database - then that will be something else - as you have to deal with passwords which if encyrpted within mssql - it might mean users have to create new passwords or you have a default password that has to be changed on first time login on the new mysql database

douglasakula left a reply on Https://stackoverflow.com/questions/54554774/proengsoft-laravel-jsvalidation-failed-working-with-using-harvesthq-chosen-libra

@mstdmstd

That's a jquery library conflict.

You will need to use 2 different alias for Jquery so the two libraries dont colide.

Check out - https://api.jquery.com/jquery.noconflict/ for documentation on using the no conflict option to resolve this.

Also many materials online on sorting Jquery library conflicts.

douglasakula left a reply on How Can I Send Multiple Mail At Once Using Controller

$peopleToSendMailTo = []; //Arrray of objects / contacts / people to send mail to

foreach($peopleToSendMailTo as $key => $personToGetMail){

 //send mail
 Mail::Send();

}


06 Feb
5 months ago

douglasakula left a reply on USPS Rate Calculator

Easiest is to check with them if they have an API that can provide the rates based on some inputs.

If they dont the other options arent very easy. One of them includes web scrapping / creating a bot that can go to the form - fill in the form and get values. - That can take time to build and test

douglasakula left a reply on Showcase Site For Your Application, Laravel Or Wordpress?

@eleven0

I would only use wordpress if I needed a blog for the website. For things like pricing, features, about us - seem like static content - which I would get a nice html theme on themeforest and use it on laravels blade templates. In my opinion - if the content on the company website will change weekly - then you are better of with a content management system that has plugins thought through like wordpress. But if the content is static - maybe change once in 6 months or a year - you can do your SEO and other things on site using laravel

douglasakula left a reply on Barryvdh/laravel-dompdf Not Downloading For Large Amount Of Records. Its Just Loading

@abdulbazith - Share the latest entries or last 10 entries - One or all of them should make sense regarding this error. You could alternatively replicate the issue by trying to create the pdf document again and see if new logs are added - its this new logs that are of interest to us and can help us point you to the right direction

douglasakula left a reply on How Can I Check Phone Number Exist Or Not From User & Payments Tables

@vickyaggarwal


if (Payments::where('phone', '=', $request->phone)->exists() || User::where('phone', '=', $request->phone)->exists()) {

               return Redirect()->back()->withInput()->with('error', 'This Number exist !');
}

05 Feb
5 months ago

douglasakula left a reply on Barryvdh/laravel-dompdf Not Downloading For Large Amount Of Records. Its Just Loading

@abdulbazith - it should have the php.ini file

are you on wamp or xampp server ?

Laravel logs should be present at /storage/logs/laravel.log

douglasakula left a reply on Barryvdh/laravel-dompdf Not Downloading For Large Amount Of Records. Its Just Loading

@abdulbazith

Most likely your application is using more memory than is allocated by default.

You probably need to adjust your php.ini memory_limit or the max_execution_time of your hosting ennvironment.

Am sure there must be an error logged for this as well. - You could share the error logged so we indentify the issue precisely

03 Feb
5 months ago

douglasakula left a reply on ACL Better Sooner Than Later?

@jonas_iliaens@icloud.com

Probably later - but its good to have it in mind as you build the product so you know what possible / or you will ship in the final product and what not possible / or you wont ship in the final product.

And about ACL - this guys have spent hours thinking this through so that you just plug and play - it might be worth a look earlier than later - https://github.com/Zizaco/entrust

douglasakula left a reply on "Call To Undefined Method App\User::profile()"

Also if you want to get the user without profiles. This would be more appropriate

$usersWithoutProfile = User::doesnthave('profiles')->get();

douglasakula left a reply on "Call To Undefined Method App\User::profile()"

@codebullet

What the name of your profiles table - profile or profiles

Could you try

$users = User::has('profiles')->get();

douglasakula left a reply on How Do I Fix Spam Search Queries By Spam Bots

@thebigk

Great. Validation will help in a significant way.

If on apache server - you can get the server logs /var/log/apache2/access.log

or running this command on terminal in your server.

sudo tail -15 tail -15 /var/log/apache2/access.log

douglasakula left a reply on How Do I Fix Spam Search Queries By Spam Bots

@thebigk

Great. If you have server access - view access logs and see the ip address the requests are coming from - you might as well just block the ip address - especially if 1 ip address is spamming the site with 10K plus requests. You can do this on .htaccess something like

Order Deny,Allow
Deny from 102.166.95.206

Should do it - if say 102.166.95.206 is the ip spamming your site

Layers at server, client level are good just in case the bots get / are smart and pass trough one layer.

douglasakula left a reply on How Do I Fix Spam Search Queries By Spam Bots

@thebigk

It could be client side or server side.

Server side - you could check server logs and see the suspicious ip address and block those ip addresses from ever accessing your server - either on htaccess file or cpanel block ip addresses.

Client side - you could add validation on the search box - such that if content that doesnt make sense is entered - the search doesnt proceed - you could also flag most commonly searched terms by the bots and ignore them when the search are done on your website ?

Have you used any popular cms to create the website or is it custom made from a framework ?

Such cms's could have anti spam modules and remedies - and even when using a framework - you have all the flexibility to add validation features or block ip addresses at server level.

douglasakula left a reply on Laraforge Payment

@successdav

They are 2 different services - so you pay for them separately. None is inclusive of the other.

douglasakula left a reply on "Call To Undefined Method App\User::profile()"

@codebullet

How does your controller look like ?

Are you using the user model on your controller ?

use App\User;

31 Jan
5 months ago

douglasakula left a reply on Laravel Project Not Shown After Upload

@gurvindersingh - You need to run php 7

A new feature in php 7 is the Null coalescing operator, which is used in the helpers file on line 233.

Are you able to tell which version of php you are running ? - is php 7 enabled ? - At times its running but php5.6 is not disabled.