bobmyles

Experience

990

0 Best Reply Awards

  • Member Since 4 Months Ago
  • 7 Lessons Completed
  • 0 Favorites

27th April, 2017

bobmyles left a reply on How To Upload An Image And Display As Logo • 2 months ago

This is how I was able to achieve this, well just in case some one else is struggling.

I changed my default disk on the file system to public i.e. (`app/config/filesystem.php)

Then created a symbolic link app/storage/app/public to app/public/storage

This enabled me to access all files on app/public/storage ....

To access the logos on the view I used img src="APP_URL/public/storage/logos/logo.png"

Thank you guys for the assistance .... About this and more here => https://laravel.com/docs/5.4/filesystem#the-public-disk

21st April, 2017

bobmyles left a reply on How To Upload An Image And Display As Logo • 2 months ago

Below is the abs path to the image;

<span class="logo-lg"><img src="/var/www/html/airtime_top_up_portal/storage/app/public/logos/bobChild/logo.png" class="img-responsive" ></span>
    </a>

Is this what you need?

bobmyles left a reply on How To Upload An Image And Display As Logo • 2 months ago

I have tried this but failed;

bobmyles left a reply on How To Upload An Image And Display As Logo • 2 months ago

Hi... I tried php artisan storage:linkbut got;

I went though the doc as well.

[ErrorException] symlink(): No such file or directory

I am on ubuntu os ..

Kindly advice

bobmyles left a reply on How To Upload An Image And Display As Logo • 2 months ago

Hi Robert, I changed the Default Filesystem Disk to use public ....

This created storage/app/public/logos/bobChild storage path..

The images are stored on the path storage/app/public/logos/bobChild/logo.png How do I create the symboilc link?

Kindly advice.

bobmyles left a reply on How To Upload An Image And Display As Logo • 2 months ago

I tried this

<span class="logo-lg"><img src="Storage::local('app/logos/Demo/logo.jpg');" class="img-responsive" ></span>

this as well;

<span class="logo-lg"><img src="storage_path('app/logos/Abc/logo.jpg')" class="img-responsive" ></span>

but there was no display

bobmyles left a reply on How To Upload An Image And Display As Logo • 2 months ago

@edoc You mean this? <img src="storage_path('logos/Demo/logo.jpg')"

bobmyles started a new conversation How To Upload An Image And Display As Logo • 2 months ago

I am using Laravel 5.4. I am creating organizations; whose details include a logo.

The intention is when a user for the organization logs in, the logo is on the display.

I am able to upload and save the logo on storage/app/logos/organization_name/logo... eg storage/logos/Abc/logo.jpg

However, I am not able to pick and display the image/logo for an organization. I have gone through the docs https://laravel.com/docs/5.3/requests#retrieving-uploaded-files but still struggling.

Kindly someone save my day.

Image Upload and save code below: $org_image = $request->org_image;

        if ($org_image !== null) {
            $fileext = $org_image->getClientOriginalExtension(); //Get file extension
            $org_image->storeAs('logos/' . $organization_name, "logo.{$fileext}"); //save file 
     
         }

How do I fetch and display this on the view diffentiating by the organization name?

Regards.

29th March, 2017

bobmyles left a reply on Trait 'Illuminate\Database\Concerns\BuildsQueries' Not Found • 2 months ago

Sorry I can not explain why but here is the fix

FIX

1. I deleted /vendor with all it's files
2. composer install
3. It worked. 

I am not sure but I think git ignored /vendor on gitignore all along?

Regards.

bobmyles started a new conversation Trait 'Illuminate\Database\Concerns\BuildsQueries' Not Found • 2 months ago

Laravel Version: 5.4.* PHP Version: 7.0.17 Database Driver & Version: Ver 14.14 Distrib 5.5.54, for debian-linux-gnu (x86_64) using readline 6.3 Description:

I am trying to login to my platform but getting this error, Trait 'Illuminate\Database\Concerns\BuildsQueries' not found

I have not done any changes on the file /vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:23 as from the logs the exception is; local.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Trait 'Illuminate\Database\Concerns\BuildsQueries' not found in /var/www/html/project_name/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:23 Stack trace: #0 {main}

I can not interpret any further as that is the information I get from the logs.

Kindly someone advice.

Regards. Bob Mwenda.

Steps To Reproduce:

I tried submitting my login form; then got the error FatalErrorException in Builder.php line 23: Trait 'Illuminate\Database\Concerns\BuildsQueries' not found on the screen.

I can not figure out how to solve this.

9th February, 2017

bobmyles left a reply on How Do I Change The Default Register And Login Controllers In Laravel 5.3? • 4 months ago

So, when I get rid of use AuthenticatesUsers; on Login Controller, I get Method App\Http\Controllers\Auth\LoginController::login() does not exist

Does this mean I will have to create manual routes for the application?

Kindly advice.

bobmyles started a new conversation How Do I Change The Default Register And Login Controllers In Laravel 5.3? • 4 months ago

I would want to have this scenario that when a user signs up, an activation token is generated and sent to the email address specified.

On the users table, I have $table->boolean('is_activated')->default(0); that should be updated to 1 if the email link is clicked by the user. Hence the user is able to login as by the login controller below.

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.