mbo

mbo

Member Since 9 Months Ago

Experience Points
6,510
Total
Experience

3,490 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
41
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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 2
6,510 XP
Apr
03
6 days ago
Activity icon

Replied to How To View Variables?

@nakov,

i tried. But got the following error;

dropzone.min.js:1 POST http://ligplaats.test/dropzone/store 500 (Internal Server Error)
c.submitRequest @ dropzone.min.js:1
c.uploadFiles @ dropzone.min.js:1
c.processFiles @ dropzone.min.js:1
c.processQueue @ dropzone.min.js:1
(anonymous) @ dropzone.min.js:1
setTimeout (async)
c.enqueueFile @ dropzone.min.js:1
(anonymous) @ dropzone.min.js:1
accept @ dropzone.min.js:1
c.accept @ dropzone.min.js:1
c.addFile @ dropzone.min.js:1
(anonymous) @ dropzone.min.js:1

As soon as i introduce the request $request it goes down.

The script i posted is working but i want to have insights wat is happening. With the script i have to issues:

  1. if i do a multi load of the images they all get the same name (he overrides them). So the file name is not set unique. I think it has to do with the [0]. Does it?

  2. i like to upload the images to DO spaces. So i have to adjust the $destinationpath. I can't get it working because i don't know how it looks like (can't see the variables)

Any idea how to solve those things?

Activity icon

Replied to How To View Variables?

Nakov,

thanks for your reply. The function is not loaded by a request. The page does not refresh. So i think it i done by javascript. How sends it by the router.

https://www.dropzonejs.com/bootstrap.html

Route::post('dropzone/store', '[email protected]');
Route::put('dropzone/store', '[email protected]');

uploadcontroller:


 /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store()
    {
      //session_start();
      $inp = Input::all();
      $destinationPath = 'storage/xxx/uploads/temp'; // upload path
      $extension = $inp["file"][0]->getClientOriginalExtension(); // getting image extension
      $fileName = Auth::id().time().$inp['file'][0]->getClientOriginalName(); // renameing image
      $inp["file"][0]->move($destinationPath, $fileName); // uploading file to given path

      return $fileName;
    }

Someone else has installed this for me in the past. Secondly i'm new in programming and don't have knowledge from javascript etc.

Any other suggestion?

Activity icon

Started a new Conversation How To View Variables?

good day,

I'm using dropzone js to upload my images. This package automatically uploads my images to a temp folder. This is done by an function in a controller. (route brings request to controller)

I want to get the values of the variables in the controller. But when i use

dd($xx);

it won't show anything,

Is there a way to breakout the function in the controller when it used to show the variable?

thanks in advance.

Apr
02
1 week ago
Activity icon

Awarded Best Reply on How To Setup Pleague Glide With Digital Ocean Spaces?

Bobby,

thanks for your reaction.

The reason why i use glide is because the package helps me the crop the images to the right dimensions. So i can keep the original in place and create a cached image with the right dimensions.

So my plan is to:

  • save the original on do spaces
  • save the cached images on my webserver

About the last step i'm thinking of putting these on do spaces as well. Don't know what is best.

What do you think about this way of working? Do you suggest a different approach?

About the problem: i got it working with help of this post: https://github.com/thephpleague/glide/issues/100

For people interested:

  • i used the default filestem adjustments
  'do-spaces' => [
            'driver' => 's3',
            'key' => 'xxx',
            'secret' => 'xxx',
            'region' => 'ams3',
            'bucket' => 'xx',
            'endpoint' => 'https://ams3.digitaloceanspaces.com',
        ],

in combination with this in my controllers.

 public function show_listing_230(Filesystem $filesystem, $path)
     {
        $server = ServerFactory::create([
            'response' => new LaravelResponseFactory(app('request')),
            'source' => Storage::disk('do-spaces')->getDriver(),
            'source_path_prefix' => '/xxx/images/listings/230',
            'cache' => Storage::disk('local')->getDriver(),
            'cache_path_prefix'     => '/xxx/images/listings/230/cache_images',
            'base_url' => 'img_listing/230/',
        ]);

         return $server->getImageResponse($path, request()->all());
     }


Activity icon

Started a new Conversation How Can I Move A File From Local To DO Spaces?

Dear all,

Currently i'm saving my temporary files first on my webserver in a "temp" folder. When they are renamed i want to move them to a digitalocean spaces.

I currently have this:

 File::move('storage/xxx/uploads/temp/'.$oldname, 'storage/xxx/images/dps/'.$newname);

In the documentation the only give a solution for moving within a storage.

Storage::move('old/file1.jpg', 'new/file1.jpg');

How can i setup a situation where i move the file from local to spaces?

thanks in advance

Apr
01
1 week ago
Activity icon

Started a new Conversation Fress Laravel 7 Causes Error By Running Npm Install

Im setting up a new new app with laravel. But during the process i get errors when i run "npm install".

question:

what are causing these errors and what to do with it?

See here the steps i have taken.

Maartens-MacBook-Pro:watersporter mbolivier$ composer require laravel/ui
Using version ^2.0 for laravel/ui
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing laravel/ui (v2.0.1): Loading from cache
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: facade/ignition
Discovered Package: fideloper/proxy
Discovered Package: fruitcake/laravel-cors
Discovered Package: laravel/tinker
Discovered Package: laravel/ui
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
Maartens-MacBook-Pro:watersporter mbolivier$ php artisan ui bootstrap --auth
Bootstrap scaffolding installed successfully.
Please run "npm install && npm run dev" to compile your fresh scaffolding.
Authentication scaffolding generated successfully.
Maartens-MacBook-Pro:xx mb$ npm install
npm WARN deprecated [email protected]: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)

> [email protected] install /Users/mb/Applications/watersporter/node_modules/fsevents
> node-gyp rebuild

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

Traceback (most recent call last):
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 16, in <module>
    sys.exit(gyp.script_main())
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 545, in script_main
    return main(sys.argv[1:])
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 538, in main
    return gyp_main(args)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 523, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2170, in GenerateOutput
    part_of_all=qualified_target in needed_targets)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 795, in Write
    self.Pchify))
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1190, in WriteSources
    cflags = self.xcode_settings.GetCflags(configname)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 551, in GetCflags
    archs = self.GetActiveArchs(self.configname)
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 420, in GetActiveArchs
    xcode_archs_default = GetXcodeArchsDefault()
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 118, in GetXcodeArchsDefault
    xcode_version, _ = XcodeVersion()
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1265, in XcodeVersion
    version = re.match(r'(\d\.\d\.?\d*)', version).groups()[0]
AttributeError: 'NoneType' object has no attribute 'groups'
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack     at ChildProcess.emit (events.js:159:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/mbolivier/Applications/watersporter/node_modules/fsevents
gyp ERR! node -v v9.2.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] requires a peer of [email protected]^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected]>= 3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

added 1146 packages in 20.165s
Maartens-MacBook-Pro:xx mb$

Activity icon

Started a new Conversation How To Upload A File To Do Spaces

Good day,

I have a form why user can upload files by ajax script. Currently the preload places the files on my local webserver. The connection with DO spaces works.

But i can't get it working to rewrite the code below so it places the file on my do spaces.

I tried to work with:

storage::disk('do-spaces')->PutFileAs();

But i don't get it running with the code blowe (some else created this part).

Uploadcontroller:

/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store()
    {
      $inp = Input::all();
      $destinationPath = 'storage/xx/uploads/temp'; // upload path
      $extension = $inp["file"][0]->getClientOriginalExtension(); // getting image extension
      $fileName = Auth::id().time().$inp['file'][0]->getClientOriginalName(); // renameing image
      $inp["file"][0]->move($destinationPath, $fileName); // uploading file to given path
      return $fileName;
    }

Help would be appreciated.

thanks in advance.

Mar
31
1 week ago
Activity icon

Replied to How To Setup Pleague Glide With Digital Ocean Spaces?

Bobby,

thanks for your reaction.

The reason why i use glide is because the package helps me the crop the images to the right dimensions. So i can keep the original in place and create a cached image with the right dimensions.

So my plan is to:

  • save the original on do spaces
  • save the cached images on my webserver

About the last step i'm thinking of putting these on do spaces as well. Don't know what is best.

What do you think about this way of working? Do you suggest a different approach?

About the problem: i got it working with help of this post: https://github.com/thephpleague/glide/issues/100

For people interested:

  • i used the default filestem adjustments
  'do-spaces' => [
            'driver' => 's3',
            'key' => 'xxx',
            'secret' => 'xxx',
            'region' => 'ams3',
            'bucket' => 'xx',
            'endpoint' => 'https://ams3.digitaloceanspaces.com',
        ],

in combination with this in my controllers.

 public function show_listing_230(Filesystem $filesystem, $path)
     {
        $server = ServerFactory::create([
            'response' => new LaravelResponseFactory(app('request')),
            'source' => Storage::disk('do-spaces')->getDriver(),
            'source_path_prefix' => '/xxx/images/listings/230',
            'cache' => Storage::disk('local')->getDriver(),
            'cache_path_prefix'     => '/xxx/images/listings/230/cache_images',
            'base_url' => 'img_listing/230/',
        ]);

         return $server->getImageResponse($path, request()->all());
     }


Mar
30
1 week ago
Activity icon

Started a new Conversation How To Setup Pleague Glide With Digital Ocean Spaces?

Good day

I'm using glide of https://glide.thephpleague.com/ for showing and cashing my images. Till now i saved my images on my webserver. No i want do place them on Digital Ocean spaces.

But i can't get it working.

current setup:

  • imagecontroler where i handle the images.
  • installed league/flysystem-aws-s3-v3

to make it working i should work with: https://flysystem.thephpleague.com/v1/docs/adapter/digitalocean-spaces/

use Aws\S3\S3Client;
use League\Flysystem\AwsS3v3\AwsS3Adapter;
use League\Flysystem\Filesystem;

$client = new S3Client([
    'credentials' => [
        'key'    => 'your-key',
        'secret' => 'your-secret',
    ],
    'region' => 'your-region',
    'version' => 'latest|version',
    'endpoint' => 'https://your-region.digitaloceanspaces.com',
]);

$adapter = new AwsS3Adapter($client, 'your-bucket-name');

$filesystem = new Filesystem($adapter);

this is what my imagecontroller looks like:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Contracts\Filesystem\Filesystem;
use League\Glide\Responses\LaravelResponseFactory;
use League\Glide\ServerFactory;
use App\Http\Requests;


class ImageController extends Controller
{

    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
     public function show(Filesystem $filesystem, $path)
     {
 
        $server = ServerFactory::create([
            'response' => new LaravelResponseFactory(app('request')),
            'source' => 'xx/uploads/images',
            'cache' => 'xx/uploads/cache_images',
            'base_url' => 'img',
        ]);

         return $server->getImageResponse($path, request()->all());
     }   

}

my question is:

where to use this extra code for the adapter? And why?

Thanks in advance.

Mar
28
1 week ago
Activity icon

Replied to Call To Undefined Function In Helper File.

Snapey, thanks for the reply. Im wondering: is there a way to set my local development to case sensitive?

i develop on: mac > valet.

thanks!

Activity icon

Replied to Call To Undefined Function In Helper File.

Bobby,

thanks for the reaction. That is also a solution indeed. I like to have it by a folder. But that is not going to work for now. Maybe it is connect to another issue i have with the fact that my env file does give any values to other files as well. Thanks anyway.

Activity icon

Replied to Call To Undefined Function In Helper File.

Bobbybouwmann,

thanks for your reply.

I thought this was the solution. But by ending the provider i didn't work on my local machine as well. So it seems that the classmap in composer.jon does not work. Any idea how to solve this?

To make sure is it not the function that is not working i called some other functions as well.

i also run composer dump autoload. Did not solve it either.

thanks for the reply

Activity icon

Replied to Laravel Installing Won't Install On Local Server

thanks! it worked out. Moved one step up in and run the command again. No issues with maps any more. Thanks for the help!

Activity icon

Replied to Laravel Installing Won't Install On Local Server

thanks!

that worked. But i placed in folder b again folder b.

To better understand; what was the laravel/laravel do?

Activity icon

Replied to Laravel Installing Won't Install On Local Server

tray2

thanks for your reaction.

yes i have

PHP 7.3.8 (cli) (built: Aug 6 2019 23:15:07) ( NTS ) Copyright (c) 1997-2018 The PHP Group

any other idea?

I looks like it moves directory. Can that cause the issue?

Activity icon

Started a new Conversation Laravel Installing Won't Install On Local Server

good day,

im trying to install a new laravel app in a new directory on my mac.

this is what i did:

  • install valet etc (long time ago)
  • running a website in folder A
  • Want to setup a website in folder B
  • Already created the folder B. It starts up by valet (tested and index.html file)

The challange:

by running

composer global require laravel/installer

i get the following error message.

Any idea what i'm doing wrong?

Thanks for the help!

Maartens-MacBook-Pro:b mbo$ composer global require laravel/installer
Changed current directory to /Users/mbo/.composer
Using version ^3.0 for laravel/installer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install laravel/installer v3.0.1
    - Conclusion: remove symfony/console v3.4.30
    - Installation request for laravel/installer ^3.0 -> satisfiable by laravel/installer[v3.0.0, v3.0.1].
    - Conclusion: don't install symfony/console v3.4.30
    - laravel/installer v3.0.0 requires symfony/console ^4.0|^5.0 -> satisfiable by symfony/console[v4.0.0, v4.0.1, v4.0.10, v4.0.11, v4.0.12, v4.0.13, v4.0.14, v4.0.15, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8, v4.0.9, v4.1.0, v4.1.1, v4.1.10, v4.1.11, v4.1.12, v4.1.2, v4.1.3, v4.1.4, v4.1.5, v4.1.6, v4.1.7, v4.1.8, v4.1.9, v4.2.0, v4.2.1, v4.2.10, v4.2.11, v4.2.12, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9, v4.3.0, v4.3.1, v4.3.10, v4.3.11, v4.3.2, v4.3.3, v4.3.4, v4.3.5, v4.3.6, v4.3.7, v4.3.8, v4.3.9, v4.4.0, v4.4.1, v4.4.2, v4.4.3, v4.4.4, v4.4.5, v4.4.6, v5.0.0, v5.0.1, v5.0.2, v5.0.3, v5.0.4, v5.0.5, v5.0.6].
    - Can only install one of: symfony/console[v4.0.0, v3.4.30].
    - Can only install one of: symfony/console[v4.0.1, v3.4.30].
    - Can only install one of: symfony/console[v4.0.10, v3.4.30].
    - Can only install one of: symfony/console[v4.0.11, v3.4.30].
    - Can only install one of: symfony/console[v4.0.12, v3.4.30].
    - Can only install one of: symfony/console[v4.0.13, v3.4.30].
    - Can only install one of: symfony/console[v4.0.14, v3.4.30].
    - Can only install one of: symfony/console[v4.0.15, v3.4.30].
    - Can only install one of: symfony/console[v4.0.2, v3.4.30].
    - Can only install one of: symfony/console[v4.0.3, v3.4.30].
    - Can only install one of: symfony/console[v4.0.4, v3.4.30].
    - Can only install one of: symfony/console[v4.0.5, v3.4.30].
    - Can only install one of: symfony/console[v4.0.6, v3.4.30].
    - Can only install one of: symfony/console[v4.0.7, v3.4.30].
    - Can only install one of: symfony/console[v4.0.8, v3.4.30].
    - Can only install one of: symfony/console[v4.0.9, v3.4.30].
    - Can only install one of: symfony/console[v4.1.0, v3.4.30].
    - Can only install one of: symfony/console[v4.1.1, v3.4.30].
    - Can only install one of: symfony/console[v4.1.10, v3.4.30].
    - Can only install one of: symfony/console[v4.1.11, v3.4.30].
    - Can only install one of: symfony/console[v4.1.12, v3.4.30].
    - Can only install one of: symfony/console[v4.1.2, v3.4.30].
    - Can only install one of: symfony/console[v4.1.3, v3.4.30].
    - Can only install one of: symfony/console[v4.1.4, v3.4.30].
    - Can only install one of: symfony/console[v4.1.5, v3.4.30].
    - Can only install one of: symfony/console[v4.1.6, v3.4.30].
    - Can only install one of: symfony/console[v4.1.7, v3.4.30].
    - Can only install one of: symfony/console[v4.1.8, v3.4.30].
    - Can only install one of: symfony/console[v4.1.9, v3.4.30].
    - Can only install one of: symfony/console[v4.2.0, v3.4.30].
    - Can only install one of: symfony/console[v4.2.1, v3.4.30].
    - Can only install one of: symfony/console[v4.2.10, v3.4.30].
    - Can only install one of: symfony/console[v4.2.11, v3.4.30].
    - Can only install one of: symfony/console[v4.2.12, v3.4.30].
    - Can only install one of: symfony/console[v4.2.2, v3.4.30].
    - Can only install one of: symfony/console[v4.2.3, v3.4.30].
    - Can only install one of: symfony/console[v4.2.4, v3.4.30].
    - Can only install one of: symfony/console[v4.2.5, v3.4.30].
    - Can only install one of: symfony/console[v4.2.6, v3.4.30].
    - Can only install one of: symfony/console[v4.2.7, v3.4.30].
    - Can only install one of: symfony/console[v4.2.8, v3.4.30].
    - Can only install one of: symfony/console[v4.2.9, v3.4.30].
    - Can only install one of: symfony/console[v4.3.0, v3.4.30].
    - Can only install one of: symfony/console[v4.3.1, v3.4.30].
    - Can only install one of: symfony/console[v4.3.10, v3.4.30].
    - Can only install one of: symfony/console[v4.3.11, v3.4.30].
    - Can only install one of: symfony/console[v4.3.2, v3.4.30].
    - Can only install one of: symfony/console[v4.3.3, v3.4.30].
    - Can only install one of: symfony/console[v4.3.4, v3.4.30].
    - Can only install one of: symfony/console[v4.3.5, v3.4.30].
    - Can only install one of: symfony/console[v4.3.6, v3.4.30].
    - Can only install one of: symfony/console[v4.3.7, v3.4.30].
    - Can only install one of: symfony/console[v4.3.8, v3.4.30].
    - Can only install one of: symfony/console[v4.3.9, v3.4.30].
    - Can only install one of: symfony/console[v4.4.0, v3.4.30].
    - Can only install one of: symfony/console[v4.4.1, v3.4.30].
    - Can only install one of: symfony/console[v4.4.2, v3.4.30].
    - Can only install one of: symfony/console[v4.4.3, v3.4.30].
    - Can only install one of: symfony/console[v4.4.4, v3.4.30].
    - Can only install one of: symfony/console[v4.4.5, v3.4.30].
    - Can only install one of: symfony/console[v4.4.6, v3.4.30].
    - Can only install one of: symfony/console[v5.0.0, v3.4.30].
    - Can only install one of: symfony/console[v5.0.1, v3.4.30].
    - Can only install one of: symfony/console[v5.0.2, v3.4.30].
    - Can only install one of: symfony/console[v5.0.3, v3.4.30].
    - Can only install one of: symfony/console[v5.0.4, v3.4.30].
    - Can only install one of: symfony/console[v5.0.5, v3.4.30].
    - Can only install one of: symfony/console[v5.0.6, v3.4.30].
    - Installation request for symfony/console (locked at v3.4.30) -> satisfiable by symfony/console[v3.4.30].


Installation failed, reverting ./composer.json to its original content.
Maartens-MacBook-Pro:b mb$



Mar
27
1 week ago
Activity icon

Replied to Call To Undefined Method - Laravel Impersonate

zsoltgyure,

Thanks for the reaction. I expected to work with the default Missed some words.

thanks for the sollution!

Activity icon

Started a new Conversation Call To Undefined Method - Laravel Impersonate

goodday,

I setting up an package: laravel impersonate.

https://github.com/404labfr/laravel-impersonate

After installing it give the following error if when i use the the following:

what i did:

composer require lab404/laravel-impersonate

Add the service provider at the end of your config/app.php:
'providers' => [
    // ...
    Lab404\Impersonate\ImpersonateServiceProvider::class,
],

Add the trait Lab404\Impersonate\Models\Impersonate to your User model.

placed: Route::impersonate();

run: php artisan vendor:publish --tag=impersonate


By running the following i get the error's

@canBeImpersonated($user)
    <a href="{{ route('impersonate', $user->id) }}">Impersonate this user</a>
@endCanBeImpersonated

error:

Call to undefined method Illuminate\Database\Query\Builder::canBeImpersonated() (View: /Users/mbolivier/Applications/ligplaats/resources/views/my-account/users/index_admin.blade.php)


any help would be appreciated.

thanks

Activity icon

Replied to Missing Required Client Configuration Options - Setting Up DO Spaces

This is what i got now:

filesytem:


        'do-spaces' => [
            'driver' => 's3',
            'key' => env('DO_SPACES_ACCESS_KEY_ID'),
            'secret' => env('DO_SPACES_SECRET_ACCESS_KEY'),
            'region' => env('DO_SPACES_DEFAULT_REGION'),
            'bucket' => env('DO_SPACES_BUCKET'),
            'endpoint' => env('DO_SPACES_URL'),
        ],

env:

DO_SPACES_ACCESS_KEY_ID=xx
DO_SPACES_SECRET_ACCESS_KEY=xx
DO_SPACES_DEFAULT_REGION=ams3
DO_SPACES_BUCKET=watiles
DO_SPACES_URL=ams3.digitaloceanspaces.com

this the reaction of thinker:


Maartens-MacBook-Pro:lis mbo$ php artisan tinker
Psy Shell v0.9.12 (PHP 7.3.8 — cli) by Justin Hileman
>>> env("DO_SPACES_ACCESS_KEY_ID")
=> null
>>> env('DO_SPACES_ACCESS_KEY_ID')
=> null
>>>

any idea?

Activity icon

Started a new Conversation Call To Undefined Function In Helper File.

I deployed my local app via github to forge/do. (from local to production)

the deployment went well. But when i try to reach a page it gives the following error:

[2020-03-26 17:13:54] production.ERROR: Call to undefined function autoVer() (View: /home/forge/default/resources/views/partials/standaard/lxx/_head.blade.php) (View: /home/forge/default/resources/views/partials/standaard/xx/_head.blade.php) (View: /home/forge/default/resources/views/partials/standaard/xx/_head.blade.php) {"exception":"[object] (ErrorException(code: 0): Call to undefined function autoVer() (View: 

It seems that laravel is not able to find a the function. In local development (mac/valet) i don't get the error.

the function is located in a helper file. Located in the folder helpers.

i got a file HelperServiceProvider where i register the total helper folder.

<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class HelperServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {
        //
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {
          foreach (glob(app_path().'/Helpers/*.php') as $filename){
           require_once($filename);
          }
    }
}

It looks like it doesn't work in production?

What can i do to solve the issue?

thanks for the reactions.

Activity icon

Replied to Missing Required Client Configuration Options - Setting Up DO Spaces

thanks agian. i changed it but did not solve the issue. I also did an composer install. Maybe that would work. But that also did not change anything. Other idea?

Activity icon

Replied to Missing Required Client Configuration Options - Setting Up DO Spaces

Sti3bas,

thanks for the reply. I did. But does not help. any other think i can do?

Activity icon

Started a new Conversation Missing Required Client Configuration Options - Setting Up DO Spaces

Good day,

I setting up do spaces for laravel.

I did the following:

  • composer require league/flysystem-aws-s3-v3
  • filesystem adjustments
'do-spaces' => [
            'driver' => 's3',
            'key' => env('DO-SPACES_ACCESS_KEY_ID'),
            'secret' => env('DO-SPACES_SECRET_ACCESS_KEY'),
            'region' => env('DO-SPACES_DEFAULT_REGION'),
            'bucket' => env('DO-SPACES_BUCKET'),
            'endpoint' => env('DO-SPACES_URL'),
        ],

env file addings

DO-SPACES_ACCESS_KEY_ID=xxxx
DO-SPACES_SECRET_ACCESS_KEY=xxxxx
DO-SPACES_DEFAULT_REGION=ams3
DO-SPACES_BUCKET=watfiles
DO-SPACES_URL=ams3.digitaloceanspaces.com

by getting an images it gave the following error:

InvalidArgumentException
Missing required client configuration options: region: (string) A "region" configuration value is required for the "s3" service (e.g., "us-west-2"). A list of available public regions and endpoints can be found at http://docs.aws.amazon.com/general/latest/gr/rande.html.

It seems it does not get the variables from the env file.

Because if i hard code them in the "filesytem' file i don't get the errors.

any help how to solve would be appriciated.

thanks in advance.

Mar
26
2 weeks ago
Activity icon

Replied to Error After Updating Composer

Snapey,

thanks for the help. I solved it by re running composer update. By following your step it went well. autoload files were created.

thanks again.

Activity icon

Replied to Error After Updating Composer

Snapey,

thanks for your reply! I did what you mentioned.

by running it i didn't get any reaction. Although gitup directly sended an email.

On March 26th, 2020 at 09:33 (UTC) your personal access token (Composer on Maartens-MacBook-Pro.local 2020-03-25 1408) using Composer/1.9.0 (Darwin; 18.7.0; PHP 7.3.8) was used as part of a query parameter to access an endpoint through the GitHub API:

https://api.github.com/repositories/15428480/zipball/xxxxxxxxxxxxxxxxxxxxxx

Please use the Authorization HTTP header instead, as using the `access_token` query parameter is deprecated. If this token is being used by an app you don't have control over, be aware that it may stop working as a result of this deprecation.

Depending on your API usage, we'll be sending you this email reminder on a monthly basis for each token and User-Agent used in API calls made on your behalf.
Just one URL that was accessed with a token and User-Agent combination will be listed in the email reminder, not all.

Visit https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param for more information about suggested workarounds and removal dates.

Thanks,
The GitHub Team


any idea what they mean with this?

secondly the error is still present.


Warning: require(/Users/mbo/Applications/lig/vendor/composer/../psy/psysh/src/functions.php): failed to open stream: No such file or directory in /Users/mbo/Applications/lig/vendor/composer/autoload_real.php on line 66

Fatal error: require(): Failed opening required '/Users/mbolivier/Applications/lig/vendor/composer/../psy/psysh/src/functions.php' (include_path='.:/usr/local/Cellar/php/7.3.8/share/php/pear') in /Users/mbo/Applications/lig/vendor/composer/autoload_real.php on line 66


Any idea how to solve this?

thanks in advance!

Mar
25
2 weeks ago
Activity icon

Started a new Conversation Error After Updating Composer

Good day,

I have updated my composer. Ending up in error. This what i did and what happend.

Thank you very much for the help!

Maartens-MacBook-Pro:lig mbo$ composer update

Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 3 installs, 61 updates, 1 removal
  - Removing phpunit/phpunit-mock-objects (5.0.10)
  - Updating composer/installers (v1.7.0 => v1.8.0): Downloading (100%)
  - Updating doctrine/event-manager (v1.0.0 => 1.1.0): Downloading (100%)
  - Updating doctrine/cache (v1.8.0 => 1.10.0): Downloading (100%)
  - Updating doctrine/dbal (v2.9.2 => v2.10.1): Downloading (100%)
  - Updating fzaninotto/faker (v1.8.0 => v1.9.1): Downloading (100%)
  - Updating sebastian/resource-operations (1.0.0 => 2.0.1): Downloading (100%)
  - Updating sebastian/exporter (3.1.1 => 3.1.2): Downloading (100%)
  - Updating sebastian/environment (3.1.0 => 4.2.3): Downloading (100%)
  - Updating sebastian/diff (2.0.1 => 3.0.2): Downloading (100%)
  - Updating sebastian/comparator (2.1.3 => 3.0.2): Downloading (100%)
  - Updating phpunit/php-timer (1.0.9 => 2.1.2): Downloading (100%)
  - Updating phpunit/php-file-iterator (1.4.5 => 2.0.2): Downloading (100%)
  - Updating phpunit/php-token-stream (2.0.2 => 3.1.1): Downloading (100%)
  - Updating phpunit/php-code-coverage (5.3.2 => 6.1.4): Downloading (100%)
  - Updating symfony/polyfill-ctype (v1.12.0 => v1.14.0): Downloading (100%)
  - Updating webmozart/assert (1.4.0 => 1.7.0): Downloading (100%)
  - Updating phpdocumentor/reflection-common (1.0.1 => 2.0.0): Downloading (100%)
  - Updating phpdocumentor/type-resolver (0.4.0 => 1.1.0): Downloading (100%)
  - Updating doctrine/instantiator (1.2.0 => 1.3.0): Downloading (100%)
  - Updating phpdocumentor/reflection-docblock (4.3.1 => 5.1.0): Downloading (100%)
  - Updating phpspec/prophecy (1.8.1 => v1.10.3): Downloading (100%)
  - Updating phar-io/version (1.0.1 => 2.0.1): Downloading (100%)
  - Updating phar-io/manifest (1.0.1 => 1.0.3): Downloading (100%)
  - Updating myclabs/deep-copy (1.9.3 => 1.9.5): Downloading (100%)
  - Updating phpunit/phpunit (6.5.14 => 7.5.20): Downloading (100%)
  - Updating psr/log (1.1.0 => 1.1.3): Downloading (100%)
  - Updating filp/whoops (2.5.0 => 2.7.1): Downloading (100%)
  - Updating symfony/finder (v3.4.30 => v3.4.38): Downloading (100%)
  - Updating doctrine/inflector (v1.3.0 => 1.3.1): Downloading (100%)
  - Updating erusev/parsedown (1.7.3 => 1.7.4): Downloading (100%)
  - Updating league/flysystem (1.0.53 => 1.0.66): Downloading (100%)
  - Updating monolog/monolog (1.24.0 => 1.25.3): Downloading (100%)
  - Updating mtdowling/cron-expression (v1.2.1 => v1.2.3): Downloading (100%)
  - Updating symfony/translation-contracts (v1.1.5 => v1.1.7): Downloading (100%)
  - Updating symfony/polyfill-mbstring (v1.12.0 => v1.14.0): Downloading (100%)
  - Updating symfony/translation (v4.3.3 => v4.3.11): Downloading (100%)
  - Updating nesbot/carbon (1.39.0 => 1.39.1): Downloading (100%)
  - Updating ramsey/uuid (3.8.0 => 3.9.3): Downloading (100%)
  - Updating symfony/polyfill-php72 (v1.12.0 => v1.14.0): Downloading (100%)
  - Updating symfony/polyfill-intl-idn (v1.12.0 => v1.14.0): Downloading (100%)
  - Updating symfony/polyfill-iconv (v1.12.0 => v1.14.0): Downloading (100%)
  - Updating doctrine/lexer (1.1.0 => 1.2.0): Downloading (100%)
  - Updating egulias/email-validator (2.1.11 => 2.1.17): Downloading (100%)
  - Updating swiftmailer/swiftmailer (v6.2.1 => v6.2.3): Downloading (100%)
  - Installing symfony/polyfill-util (v1.14.0): Downloading (100%)
  - Installing symfony/polyfill-php56 (v1.14.0): Downloading (100%)
  - Updating symfony/debug (v3.4.30 => v3.4.38): Downloading (100%)
  - Updating symfony/polyfill-php70 (v1.12.0 => v1.14.0): Downloading (100%)
  - Updating symfony/http-foundation (v3.4.30 => v3.4.38): Downloading (100%)
  - Updating symfony/event-dispatcher-contracts (v1.1.5 => v1.1.7): Downloading (100%)
  - Updating symfony/event-dispatcher (v4.3.3 => v4.4.5): Downloading (100%)
  - Updating symfony/http-kernel (v3.4.30 => v3.4.38): Downloading (100%)
  - Updating symfony/process (v3.4.30 => v3.4.38): Downloading (100%)
  - Updating symfony/routing (v3.4.30 => v3.4.38): Downloading (100%)
  - Updating tijsverkoyen/css-to-inline-styles (2.2.1 => 2.2.2): Downloading (100%)
  - Removing dnoegel/php-xdg-base-dir (0.1)
  - Installing dnoegel/php-xdg-base-dir (v0.1.1): Downloading (100%)
  - Updating nikic/php-parser (v4.2.3 => v4.3.0): Downloading (100%)
  - Updating symfony/var-dumper (v3.4.30 => v3.4.38): Downloading (100%)
  - Updating symfony/console (v3.4.30 => v3.4.38): Downloading (100%)

Till here everything like to work normaly.

Here he asked for the token key. I got it from github

  - Updating psy/psysh (v0.9.9 => v0.9.12): Downloading (0%)GitHub API limit (0 calls/hr) is exhausted, could not fetch https://api.github.com/repos/bobthecow/psysh/zipball/xxxxxxxxxxxxxxxx. Create a GitHub OAuth token to go over the API rate limit. You can also wait until ? for the rate limit to reset.

Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+xxxxxx-MacBook-Pro.localxxxxxxxxxxxx

to retrieve a token. It will be stored in "/Users/xxxxxx/.composer/auth.json" for future use by Composer.

I think i pasted the token 2 times. Causing the password to be wrong.

Token (hidden):
    Update failed (The 'https://api.github.com/' URL could not be accessed: HTTP/1.0 400 Bad Request
)

he asked to reinstall the package again. I said no.

    Would you like to try reinstalling the package instead [yes]? no

i got this error

  [Composer\Downloader\TransportException]
  The 'https://api.github.com/' URL could not be accessed: HTTP/1.0 400 Bad Request

ending up in this.

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [--with-dependencies] [--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...

Maartens-MacBook-Pro:ligplaats mbolivier$ composer update

But if i now load my page i get the following error:


Warning: require(/Users/mbo/Applications/lig/vendor/composer/../psy/psysh/src/functions.php): failed to open stream: No such file or directory in /Users/mbo/Applications/lig/vendor/composer/autoload_real.php on line 66

Fatal error: require(): Failed opening required '/Users/mbolivier/Applications/lig/vendor/composer/../psy/psysh/src/functions.php' (include_path='.:/usr/local/Cellar/php/7.3.8/share/php/pear') in /Users/mbo/Applications/lig/vendor/composer/autoload_real.php on line 66

I have really no idea what is causing the error. How can i solve this?

Thanks in advance!

br

maarten

Mar
23
2 weeks ago
Activity icon

Replied to Database: Pagination - Links() Not Working

Thanks! tried pull but doesn't work in view. Except also creates the array.

Thanks for the help!

Activity icon

Replied to Database: Pagination - Links() Not Working

Thanks works! thought to difficult..-)

Only challenge i got now i see is that the _token is also given in url. Any idea how i can get that variable out?

thanks in advance!

Activity icon

Started a new Conversation Database: Pagination - Links() Not Working

good day,

I'm setting up a complex query. Depending on different variables. Coming from a form.

Loading of the page works fine. Also the setting of pagination -> links().

$request =

Request {#43 ▼
  #json: null
  #convertedFiles: []
  #userResolver: Closure {#446 ▶}
  #routeResolver: Closure {#440 ▶}
  +attributes: ParameterBag {#45 ▶}
  +request: ParameterBag {#44 ▼
    #parameters: array:17 [▼
      "_token" => "Ds5L96HxUVDNVRDbd413P5MRDfsMQnpKgethC7lK"
      "formatted_address" => ""
      "dp_street" => ""
      "dp_housenum" => ""
      "dp_zipcode" => ""
      "dp_place_name" => ""
      "dp_department_name" => "Zuid-Holland"
      "dp_country_name" => ""
      "dp_latitude" => "52.0207975"
      "dp_longitude" => "4.4937836"
      "type" => "dps"
      "dp_distance" => ""
      "dp_department_id" => "31"
      "dp_place_name_id" => ""
      "dp_region_name" => ""
      "dp_region_id" => ""
      "dp_place_id" => ""
    ]
  }

But when you click next the query breaks. It seems that the query is not executed because the variable out of the request are missing.

$request =

Request {#43 ▼
  #json: null
  #convertedFiles: []
  #userResolver: Closure {#445 ▶}
  #routeResolver: Closure {#439 ▶}
  +attributes: ParameterBag {#45 ▶}
  +request: ParameterBag {#51 ▼
    #parameters: array:1 [▼
      "page" => "2"
    ]
  }

It seems that links() needs the same #request variables. How can i pass these? I tried " appending" but did not work out.

{{ $dps->appends([$request->toarray()])->links() }}

It is an search form. So the variables differ every time.

Is there a way to solve this?

thanks in advance.

br

maarten

Mar
21
2 weeks ago
Activity icon

Started a new Conversation Multi Domains To Single Laravel App

Hello,

i have a question about setting up a multi site on a single laravel app.

I want to achieve the following:

  • domain a
  • domain b
  • domain c

All connected to on single laravel app. Users must be able to login form every domain into the main backoffice (white label backoffice for all websites).

I understood that it can be done by adjusting the web route file.

Currently i have to following: see below.

My question is:

  • how to setup a multi website in the routes file?
  • How to deal with the admin section in my app. Is it possible to make it available under the 3 domain? And if so, how?

any best practices?

Thanks in advance.

br

maarten

<?php


/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of the routes that are handled
| by your application. Just tell Laravel the URIs it should respond
| to using a Closure or controller method. Build something great!
|
*/


// routes for frontend pages

/*
|--------------------------------------------------------------------------
| Authentication
|--------------------------------------------------------------------------
*/

//routes user login

/*
|--------------------------------------------------------------------------
| Super Admin
|--------------------------------------------------------------------------
*/

Route::group(['middleware' => ['roles'], 'roles' => ['Superadmin']], function()
{

// routes backoffice

});



/*
|--------------------------------------------------------------------------
| Admin
|--------------------------------------------------------------------------
*/


Route::group(['prefix' => 'my-account',  'middleware' =>['roles','owners'], 'roles' => ['Superadmin','Admin','Editor']], function()
{

// routes backoffice 

});


Mar
20
2 weeks ago
Activity icon

Replied to Passing Data To Url -> Best Method

jlrdw, thanks for your reaction. What do you mean with that?

Activity icon

Replied to Passing Data To Url -> Best Method

Snapey,

thanks for your reaction. It here a way tot get something like this.

xxxx.test/zoek?name=Victoria

thank for your reply

Activity icon

Started a new Conversation Passing Data To Url -> Best Method

Good day,

I like pass some data to another view and put that data in the url.

I did the following for a link:

{!!Html::LinkRoute('dps.zoek', trans('forms.uitgebreid') , 
array( 'type' => $request->dp_type, 'depart_id' => $request->dp_department_id, 'place_id' => $request->dp_place_id, 'region_id' => $request->dp_region_id, 'search'=>'yes' ),
 array('class'=>'search_header') )!!}

result:

http://xxxx.test/zoek?type=230&depart_id=31&place_id=385&search=yes

This works fine. No i want to do this the same for a form. Hereby the variables enter the controller by

$request

I want to put the variables in url by giving it back to the view.

I tried this

return view('pages.search_extended',['name' => 'Victoria'])->withDps($dps);

But it does not bring it up in my url. How can i accomplice that?

Or can't i do it by return view? And should i do this?

return redirect()->route('listings.index')->with('data', ['listing_type_id' =>$listing->listing_type_id]);

Thanks for the reaction.

Mar
19
3 weeks ago
Activity icon

Started a new Conversation Laravel Forum Package

Good day,

i'm thinking of setting up an forum for my website. Before doing so i'm wondering if any body knows a good laravel package to use?

For instance: this laracast forum would be great. Is this available somewhere?

Thanks for the reaction

br

maarten

Mar
17
3 weeks ago
Activity icon

Replied to Laravel Mail By Markdown Messages

thanks!! It solved it! have a good day!

Activity icon

Started a new Conversation Laravel Mail By Markdown Messages

Good day,

I'm trying to setup a markdown message.

Issue i got:

Undefined variable: user (View: /Users/mbolivier/Applications/xxxx/resources/views/emails/CommentSendMail.blade.php)

This is what i did:

php artisan make:mail CommentReceivedMail --markdown=emails.CommentReceivedMail

It all worked fine.

Setup the files:

CommentSendMail.php

<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class CommentSendMail extends Mailable
{
    use Queueable, SerializesModels;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($user, $comment, $dp, $request)
    {
    
    $this->request = $request; 
    $this->dp = $dp; 
    $this->comment = $comment; 
    $this->user = $user;
    $this->email = $user->email;
    $this->name = $user->firstname.' '.$user->lastname;
    $this->comment_subject = 'Beste' .($user->firstname). 'uw review is geplaatst' ;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->from($this->email, $this->name)
                    ->subject($this->comment_subject)
                    ->markdown('emails.CommentSendMail');
    }
}


If i dd(user) i get the right user. So the variable is set so far.

in the view blade it is not picked up. And gives the error as described.

this is he CommentSendMail.blade.php:

@component('mail::message')
Beste {{($user->firstname)}} ,</br>



@endcomponen

All help is appreciated. Thanks in advance.

Feb
25
1 month ago
Activity icon

Replied to Laravel On Shared Hosting

Sinnbeck,

thanks for the reply. The issues is that i don't have any knowledge of server management. I know there are setups for deploying etc. But what about backups of your files and database.

Any tips on that?

Activity icon

Started a new Conversation Laravel On Shared Hosting

hello,

I like to put my laravel installation on a shared hosting.

I found two ways of installing:

Method 1

Method 2

I wondering what method is better? Is there a security issue with method 2? By installing the total installation in a public folder?

thanks for the reply

Activity icon

Replied to Middleware Error

thanks, i will check the hosting provider

Activity icon

Replied to Middleware Error

I have to think how i have done it (have set this a long time ago).

this is how i load all files in the helpers directory.


namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class HelperServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {
        //
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {
          foreach (glob(app_path().'/Helpers/*.php') as $filename){
           require_once($filename);
          }
    }
}

The question is if this is doing the job.

Is there a way to check if the fill is loaded?

Activity icon

Replied to Middleware Error

Sinnbeck,

thanks for your reply. The reason why i added it has to do with the fact that localy the website works. On the shared hosting it doesn't.

So installing the website with this methode: https://dev.to/asapabedi/deploying-laravel-5-applications-on-shared-hosting-without-the-use-of-ssh--16a6 is creating an error.

Is there a way to check if the helper files are loaded?

thanks for the reaction

Activity icon

Replied to Middleware Error

JlRDW,

thanks for the reply. Additional on the former error i get a other error (in local production it works).

Call to undefined function autoVer() (View: xxxx

in the view i have this code:

<link rel="stylesheet" type="text/css" href="<?php echo e(autoVer("css/styles.css")); ?>">

this should trigger a helper file. In this helper file there is function:

function autoVer($url){
    $path = pathinfo($url);
    $ver = filemtime($_SERVER['DOCUMENT_ROOT'].$url);
    echo '/../'.$path['dirname'].'/'.$path['basename'].'?v='.$ver;
}

Any idea why the function is not reached?

Hope you can help me with this.

br

maarten

Activity icon

Started a new Conversation Url Validation Including Prefill Http(s)//

Hello,

Background: I have a form where companies have to fill in their url.

Challenge: Companies fill the url field with their url but they won't start with http(s)//. Because of the validation this causes an error for almost each user. I need the full url including the http(s)//.

What is the best practice here?

I was thinking about:

Create form where the user can:

  • Pre fill the form with (1) https:// or (2) http://
  • User has to select 1 or 2.
  • User has to fill the rest of the url
  • Both pre fill and rest url have to be past in 1 variable.
  • Validation has to check the variable.

I wondering if someone can help me with this. I prefer an clean and easy solution.

Thanks in advance!

Activity icon

Replied to Middleware Error

indeed: case sensitive caused the error! thanks! (im new in this.. :-) )

Activity icon

Started a new Conversation Middleware Error

Hello,

i have an questions about an error i get. The situation is as follows:

  • in my local development setup my website works fine.

I have set the website up on a shared hosting account. I did this by following this tutorial: https://dev.to/asapabedi/deploying-laravel-5-applications-on-shared-hosting-without-the-use-of-ssh--16a6

This resulted in the following:

  • Frontend works fine
  • When trying to login i get the following error: Class App\Http\Middleware\CheckRole does not exist

Any idea how to solve this?

Help would be very appreciated.

thanks in advance.

Dec
14
3 months ago
Activity icon

Replied to What Type Of Hosting

Thanks for your reply. But force does not help te setup email, backup,etc. Is it?

Dec
13
3 months ago
Activity icon

Started a new Conversation What Type Of Hosting

I'm looking for hosting solutions. I'm thinking of going for shared hosting with an cpanel and so. I don't have the knowledge to setup something for myself.

Forge could be an solution but doesn't setup thinks like email, subdomains, etc. And what to do is something goes down.

I thinking of siteground. What is your opinion about this? Any advice?

thanks!

Dec
12
3 months ago
Activity icon

Awarded Best Reply on Syncing Pivot Values

Solved, by creating an array with only the values which i used for the sync.

Activity icon

Replied to Syncing Pivot Values

Solved, by creating an array with only the values which i used for the sync.

Activity icon

Started a new Conversation Syncing Pivot Values

I have an issue with syncing pivot values. I allready use it within my app but i don't see the issue this time.

I got the following:

  • dps connected to an region (place on the map)
  • In the relationship i want to save a value saying 1=5km range, 2 range of 20km

This is my code:

models:

dp


  public function regions() {

  return $this->belongsToMany('App\Region','dp_region')->withPivot('dp_region_value');
  }

controller

 if(!empty($region_in_range)) {
        $region_unique = $region_in_range->unique();
        $dp -> regions() -> sync($region_unique,['dp_region_value' => 'dp_region_value'],false);
    } else {
        $dp -> regions() -> sync(array());
    }

dd ($region_unique)

Collection {#699 ▼
  #items: array:5 [▼
    0 => Region {#997 ▼
      #table: "regions"
      #connection: "mysql"
      #primaryKey: "id"
      #keyType: "int"
      +incrementing: true
      #with: []
      #withCount: []
      #perPage: 15
      +exists: true
      +wasRecentlyCreated: false
      #attributes: array:17 [▼
        "id" => 1
        "region_name" => "Kaplassen"
        "region_name_slug" => "kplassen"
        "region_discription" => "▶"
        "region_ranking" => 1
        "region_show1" => 1
        "region_show2" => 1
        "region_show3" => 1
        "region_status_id" => 1
        "region_latitude" => 52.19946
        "region_longitude" => 4.541771
        "region_range" => 10
        "created_at" => "2016-11-01 10:50:37"
        "updated_at" => "2016-11-01 10:50:37"
        "dp_distance" => 5.4647710778154
        "within_range" => "within"
        "dp_region_value" => 1
      ]
      #original: array:14 [▶]
      #changes: []
      #casts: []
      #dates: []
      #dateFormat: null
      #appends: []
      #dispatchesEvents: []
      #observables: []
      #relations: []
      #touches: []
      +timestamps: true
      #hidden: []
      #visible: []
      #fillable: []
      #guarded: array:1 [▶]
    }
    1 => Region {#994 ▶}
    2 => Region {#989 ▶}
    3 => Region {#790 ▶}
    4 => Region {#776 ▶}
  ]
}

db

CREATE TABLE `dp_region` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `dp_id` int(10) unsigned NOT NULL,
  `region_id` int(10) unsigned NOT NULL,
  `dp_region_value` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `dp_region_dp_id_foreign` (`dp_id`),
  KEY `dp_region_region_id_foreign` (`region_id`),
  CONSTRAINT `dp_region_dp_id_foreign` FOREIGN KEY (`dp_id`) REFERENCES `dps` (`id`),
  CONSTRAINT `dp_region_region_id_foreign` FOREIGN KEY (`region_id`) REFERENCES `regions` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1844 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

it syncs the region_id but does not the pivot value. I don't really know how to debug this process.

Does somebody see what i do wrong?

Thanks in advance!