MarkLL

MarkLL

Member Since 4 Years Ago

Sydney

Experience Points 20,210
Experience Level 5

4,790 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 350
Lessons
Completed
Best Reply Awards 12
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.

12 Apr
2 weeks ago

MarkLL left a reply on How Do I Read Source Code That Eventually Leads Back To An Interface?

I usually start out by searching for classes that implement the interface. For this case the number of files in the lib are quite small so it was easy to find. Ultimately, the "key" files of interest are really in the Rules folder. Check out https://github.com/doctrine/inflector/blob/master/lib/Doctrine/Inflector/Rules/English/Inflectible.php this is the file that actually determines what transformations occur.

In theory, you should be able to implement your own language rules quite easily because they use interfaces :)

Just as a tip. In laravel, you can use tinker to find the concrete class e.g.

$>tinker
Psy Shell v0.9.8 (PHP 7.2.4 — cli) by Justin Hileman
>>> app()->get(Illuminate\Contracts\Cache\Repository::class);
=> Illuminate\Cache\Repository {#171}
>>>  

I just love tinker ;)

03 Apr
3 weeks ago

MarkLL left a reply on How To Open A Pdf Saved In A Database On A New Tab

Hey @rcatelan have you tried the following?

return response($pdf, 200, [
    'Cache-Control' => 'no-cache private', 
    'Content-Description' => 'File Transfer', 
    'Content-Type' => 'pdf', 
    'Content-length' => strlen($pdf), 
    'Content-Disposition' => 'attachment; filename=test.pdf',
    'Content-Transfer-Encoding' => 'binary']);

or better yet, try the streamDownload() method if using 5.8 see https://laravel.com/docs/5.8/responses#file-downloads

18 Mar
1 month ago

MarkLL left a reply on Environment Variables And Config In 5.8

Last time I looked, it was not advisable to use .env / Dotenv for production. If you search you will find plenty of examples when it either 1) doesn't read the file or 2) reads the wrong file / bleeds the environment to other instances. It's quite easy to simulate on my local environment especially if I launch 2 different apps at the same time.

I not use config:cache in production so it writes all the settings to a file on the server and this I believe is recommended or at least it was ;).

Also you should only use env() in the config files. Once the app is loaded use config() in your code to find the values you want.

MarkLL left a reply on How To Customize Laravel Auth Login And Registration System?

Hey @flex a couple of things to do.

  1. run artisan make:auth so all the necessary files are created.
  2. Modify resources/views/auth/login.blade.php Change references from email to nic. Make sure the case of the field name matches the user table
  3. Modify app/Http/Controllers/Auth/LoginController.php define (or modify) username() method e.g.
    public function username()
    {
        return 'nic';
    }

as long as you are using the User model supplied for your user table it should just work.

The actual functions that perform all the work (and use usename() method) you can find in vendor/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php. If any of these need to be modified, just add them to the LoginController.php to over ride their behavior, but it really should just work :)

17 Mar
1 month ago

MarkLL left a reply on Add Captcha Dynamically On Login Failure

@VIKRAMBHASKARAN - Why not use the session to record the attempts? e.g.

protected function sendFailedLoginResponse(Request $request) {
    $attempts = 0;
    if ($request->session()->has('login_attempts')) {
        $attempts = $request->session()->get('login_attempts');
    }

    $request->session()->put('login_attempts', $attempts + 1);
       

    return back()->withErrors(['email' => 'Credentials do not match, try again']);
}

and in your rules method

public function rules() {
    $rules = [
            'firstname' => 'required',
            'lastname' => 'required',
            'email' => 'required|email',
            'password' => 'required|confirmed|min:6'
    ];

    $attempts = 0;
    if (request()->session()->has('login_attempts')) {
        $attempts = request()->session()->get('login_attempts');
    }

    if ($attempts > 2) {
        $rules['g-recaptcha-response'] = 'recaptcha';
    }

    return $rules;
}

I'm sure you get the idea...

16 Mar
1 month ago

MarkLL left a reply on Method::create Won't Accept Certain Values

You need to change:

public function store(Post $post)

to

public function store(Post $post_id)

or better yet, change the placeholder name in the route /posts/{post}/comment. The name of the placeholder in the route needs to match the variable name in the controller.

07 Feb
2 months ago

MarkLL left a reply on How Do I Decrypt In Openssl Something I Encrypted

@MNT_GRRRL - Crypt::encrypt*() uses the openSSL function, however it also wraps the encrypted string with a hash to ensure it's not changed.

Can you run php from the command line? if yes, then have a look at vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php and make up a utility to un-encrypt it.

You could always create an Artisan command to decrypt it via you Laravel app command line as well.

21 Jan
3 months ago

MarkLL left a reply on Filtered Lists - Array - Collections

Why not use the assigned list in the companies query. e.g.

//Find the companies which are assigned to the user
$assigned_companies = $user->companies;

//Get the list of companies excluding what we have assigned
$companies = Company::whereNotIn('id',$assigned_companies->pluck('id)->toArray())->get();

That way you have 2 complete Collections to pass to your view.

20 Dec
4 months ago

MarkLL left a reply on OK So Tabs Have Been Outlawed...

@DAVESTEAD - Hey @davestead I understand you predicament entirely! I'v always used Notepad++ and the advantages of tabs was 1) only one symbol (arrow) instead of 4 dots. Less visual clutter. 2) you could happily tap away on the right arrow key and navigate very easily. Especially when you wanted to get to the start of the text it was predicable and efficient.

These days, I've turned off the visual display of special characters and I use the Home key to navigate to the beginning of the text, (or twice to get to the start of the line).

I do understand your sentiments ... unfortunately change is always inevitable. Just think of it as the effects of Far from equilibrium thermodynamics.

17 Dec
4 months ago

MarkLL left a reply on Language Setting

resources/lang/en/id.php

<?php
return [
    'home' => 'Beranda',
];

config/app.php

     'locale' => 'en',

Tinker:

d:\Dev\SomeApp>tinker

Psy Shell v0.9.6 (PHP 7.2.4 — cli) by Justin Hileman
>>> app()->version();
=> "5.6.28"
>>> __('id.home');
=> "Beranda"
>>>

Also what is your fallback_locale set to?

MarkLL left a reply on Language Setting

@davy_yg if it print the code (e.g. id.home) instead it means that it was not found.

Also you have the directory structure wrong. What you should do to start is to copy resources/lang/en/* to resources/lang/id/ then edit the files (in the id folder) and change the contents to their equivalent.

Also if you create a menu.php file you will need to use @lang('menu.home') etc. You can always use Tinker to test after you set up the files but will need to use __('menu.home') for that.

12 Dec
4 months ago

MarkLL left a reply on Laravel Does Not Display Images In The View From Storage Folder

Can you see the file in the storage/app/public/cover_images folder? this should be the actual location where the files are saved assuming you used something like Storage::disk('local')->put('cover_images/' . $book->image', 'Image Contents'); to place it there. If it is there, check that the link is setup correctly.

11 Dec
4 months ago

MarkLL left a reply on Laravel Does Not Display Images In The View From Storage Folder

@derkraizer try <img src="{{ asset('storage/cover_images/'. $book->image) }} ... > or just this which is the same without the protocol. "/storage/cover_images/{{ $book->image }}"

06 Dec
4 months ago

MarkLL left a reply on Upload Multiple Files To AWS S3 From Laravel?

@AJCK - Hi @ajck What $this->fetchFilenamesToUpload() did was to iterate a directory, and yield the $keyToFile => $pathToFile so I could handle any size and it fitted the promise model. However, yes it's basically a filename => path key pair.

Personally I only ever use env() in config files but shouldn't make any difference. Better to move the env() call outside the loop though and assign a variable imho.

Because it was only a devtool, I did not go too deep into error recovery. I did try it, but it didn't recover very well LOL.

03 Dec
4 months ago

MarkLL left a reply on Upload Multiple Files To AWS S3 From Laravel?

@ajck I wrote an Artisan command to upload a directory of files to S3. It involves using MultipartUploader() and Promises. It handled 25 concurrent uploads and several of these were > 1GB. I was very impressed in the end. roughly it went like this...

$s3Client = AWS::createClient('s3');
$bucket = config('aws.bucket');
$promises = [];
foreach( $this->fetchFilenamesToUpload() as $keyToFile => $pathToFile) {
    $uploader = new MultipartUploader($s3Client, $pathToFile, [
                'bucket'          => $bucket,
                'key'             => $keyToFile,
                'concurrency'     => 25,
                'before_complete' => function (AWSCommand $command) use ($keyToFile) {echo 'before_complete... (' .$keyToFile . ')'. PHP_EOL; },
                'before_initiate' => function (AWSCommand $command) use ($keyToFile) {echo 'before_initiate... (' .$keyToFile . ')'. PHP_EOL; },
                'before_upload'   => function (AWSCommand $command) use ($keyToFile) {echo 'before_upload...   (' .$keyToFile . ')' . PHP_EOL; }
    ]);
    $promises[] = $uploader->promise();
}
$aggregate = \GuzzleHttp\Promise\all($promises);
$result = $aggregate->wait();

You don't really need all the output I added, as this was a dev tool, I just wanted to see what was happening.

29 Nov
4 months ago

MarkLL left a reply on Fix .dev Domain In MAMP PRO

@abdurrehman you should use your first self signed cert as the CA cert (your Organization). Now create a CSR for your PC, add all the extra domains in the SAN section and create a cert based on that. I had some fun and games sorting out how to get the SAN data through but eventually it worked. Now just load the CA Cert (self signed) and add it to your trusted CA section (sorry I'm a windows person so can't help u there). Now all certs you create with the CA Cert will be trusted.

I run all my development as https now.

24 Oct
6 months ago

MarkLL left a reply on Configuring Nginx On Windows

@ashokvishnu is this the cause? https://stackoverflow.com/questions/46028755/nginx-no-input-file-specified

Try including your complete nginx.confthe other thing is to create a php file php.php (which contains <?php phpinfo();) in the public folder and call that to see if it works and then check the output for anything obvious.

23 Oct
6 months ago

MarkLL left a reply on Configuring Nginx On Windows

Hey @ashokvishnu You conf is not formatted very well but it looks like you have a location within a location. Also where is the fastcgi_pass statement?

I set up all my dev sites in their own conf file on my windows machine. The main nginx.conf file contains include ../../vhosts/*.conf; at the bottom (before the last closing brace for the html{} section) to load all my sites. Each one is similar to the following:

server {
    listen       80;
    server_name  marktest.local
    root D:/dev/marktest/public;
    access_log  logs/$host.access.log;

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

    # Standard PHP to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
      fastcgi_pass   127.0.0.1:9000;
      fastcgi_index  index.php;
      fastcgi_buffering on;
      
      include fastcgi.conf;
    }
}

Here is an example of the batch file I use to start it all.

start-nginx-php.cmd

echo Starting nginx config (includes PHP 7.2 FastCGI)...
set phpPath=D:\wamp\bin\php\php7.2.4nts
set nginxPath=D:\wamp\bin\nginx\nginx1.13.9

start /D "%phpPath%" /MIN php-cgi.exe -b 127.0.0.1:9000 -c %phpPath%\php.ini

timeout /t 1
start /D "%nginxPath%" nginx.exe
echo.
echo Done...

Hope that helps.

20 Aug
8 months ago

MarkLL left a reply on Strange Route Model Binding Behavior

Hi @rocketvalley have you tried with

return view('app.projects.show', ['project' => $project]);

I just tested and adding abcafter the record ID returns a 404 page for me.

18 Aug
8 months ago

MarkLL left a reply on Laravel Eloquent Timstamps / Parsing Timestamps

If you are actually storing them as timestamps, try this...

$users = User::where('last_visit', '<', Carbon::now()->subMonths(1)->timestamp)->->orderBy('last_visit', 'desc')->get();

MarkLL left a reply on Prevent Dynamically Added Input Fields Being Rested If The Validation Fails

Have you checked if they are contained in old()? As long as there are names associated you should find them using old('name').

something like...

<input type="text" value="{{ null != old('name') ? old('name') : 'whatever' }}>

I generally store them in an array and loop through adding the content back that was dynamically added prior to validation.

MarkLL left a reply on Laravel-MIX "npm Run Dev" Error | Laravel 5.6

For me (in a Windows 10 environment) I now use PowerShell in Admin mode exclusively for node/npm related activities. I also had to install the build utilities as I don't have any other compilers installed.

The other option I have used is to use the Windows Linux Subsystem (bash) and run it from there. Although these days I normally load Redis this way cause the lua debugger works.

01 Aug
8 months ago

MarkLL left a reply on How To Calculate Total Likes Of Users All Post

@Dev0ps your $posts variable contains just the ids, so why not try a count using wherein with the returned collection of id's.

 $posts = Post::whereUserId(Auth::id())->get(['id']);

$total = PostLike::whereIn('post_id',  $posts->toArray())->count();
31 Jul
8 months ago

MarkLL left a reply on Making A Laravel 5.4 Query On A JSON Field Containing A JSON Array

If you are only storing UUIDs in that format, then why not just do a like search and include the uuid and double quotes?

$users = User::where('agencies', 'like', '%"0eb2edf0-50cb-44ff-a0a6-b2a104a9dc12"%')->get();

and yes @Shahrukh4 I agree it is formatted incorrectly for multiple entries.

26 Jul
9 months ago

MarkLL left a reply on Dynamic Watermarks Over Images

@pickab00 did you try this composer require ar-php/ar-php?

Check you composer.json file, maybe it's already installed?

or check out http://www.ar-php.org/ It might make more sense to you :)

Also there are a couple of versions available on Github: https://github.com/tawfekov/ar-php and https://github.com/Johntaa/ar-php.

MarkLL left a reply on Dynamic Watermarks Over Images

Hey @pickab00, see if this helps https://github.com/Intervention/image/issues/630

e.g.

install the Ar-PHP Library

then do the following

        $Arabic = new I18N_Arabic('Glyphs');
        $name = $Arabic->utf8Glyphs($student->name_ar);
        $img->text($name, 800, 220, function ($font) {
            $font->file('fonts/trado.ttf');
            $font->size(40);
            $font->align('right');
        });
i try both font trado and arial and work perfectly.
15 Jul
9 months ago

MarkLL left a reply on Uninstall Vmware But Still Port 80 Blocked

@mitismirza for netstat command to work correctly you need to be it in an Admin cmd prompt. Also try netstat -anb This works for me but is verbose so you may need to pipe it though more. e.g. netstat -anb | more or add -p TCP to restrict it to TCP protocol only.

16 May
11 months ago

MarkLL left a reply on Laravel MySQL Connection Compression?

@jmar83 Is there a special reason for the ',' ? It's a coding style more than anything. Both are correct although other languages are more fussy about the last comma.

It's said, that having the extra comma enables you to add extra items to the end and not forget to add the comma - so to speak. It's purely personal.

From http://php.net/manual/en/function.array.php

Having a trailing comma after the last defined array entry, while unusual, is a valid syntax.
01 May
11 months ago

MarkLL left a reply on Laravel Deploy With EB CLI Public/storage Wipe Out

Its the same as the DB in that it needs to be in a separate container and S3 is the best medium for the storage of files.

Hopefully the DB is stored in an RDS instance and not an EC2 instance!

Again this is just my opinion - with a bit of experience thrown in...

MarkLL left a reply on Laravel Deploy With EB CLI Public/storage Wipe Out

Two choices IMHO.

  1. Back it up! create a job that backs up the folder to an S3 bucket.
  2. Change you app to store it in an S3 bucket... this is the correct answer i feel :).

If the EC2 instance crashes and it recovers, you will loose you files again... Where is the db stored?

26 Apr
1 year ago

MarkLL left a reply on Image Upload Using Laravel And Ajax.

Hey @beginner_luck ... just a thought, if you are using $('.edit-modal').click( ... ) to detect the Edit click for your newly added buttons, then this will not work.

Basically the above only works with elements existing when first loaded. Try this instead.

$(document).on('click', '.edit-modal', function(){ 
    // Your Code
});
23 Jan
2 years ago

MarkLL left a reply on Session Persist With Redis

Hi @Devmaurice I suspect it's cause you are using dd(). Basically this destroys the session before it gets saved. Try returning a json version so the session completes correctly. - I've seen the same behavior trying to check the session attributes in a controller.

10 Nov
2 years ago

MarkLL left a reply on Count Number Of Items In Queue That Match Specific Rules? $10 For Solution

Ahh, so I wasn't actually sure why you wanted the counts, but yes you are correct if thats what you want the count for.

You just use the zincrby command with 1 when adding and specify -1 when removing.

MarkLL left a reply on Count Number Of Items In Queue That Match Specific Rules? $10 For Solution

Actually @pmx you won't have to do that all all! That's the beauty of Redis. Leave all you queue handling as it is and just use the Redis facade as I showed above. (well actually with a slight fix cause we use the default connection)

As long as your Campaigns have a unique identifier of some kind.

Here is a dump from Tinker to give you an idea.

>>> Use \Redis;
=> null
>>> Redis::command('zincrby', ['sset:CampaignStats', 1, 'Campaign:001']);
=> "1"
>>> Redis::command('zincrby', ['sset:CampaignStats', 1, 'Campaign:001']);
=> "2"
>>> Redis::command('zincrby', ['sset:CampaignStats', 1, 'Campaign:002']);
=> "1"
>>> Redis::command('zincrby', ['sset:CampaignStats', 1, 'Campaign:003']);
=> "1"
>>> Redis::command('zincrby', ['sset:CampaignStats', 1, 'Campaign:001']);
=> "3"
>>> Redis::command('zincrby', ['sset:CampaignStats', 1, 'Campaign:002']);
=> "2"
>>> Redis::command('zincrby', ['sset:CampaignStats', 1, 'Campaign:003']);
=> "2"
>>> Redis::command('zincrby', ['sset:CampaignStats', 1, 'Campaign:001']);
=> "4"
>>> Redis::command('zrange', ['sset:CampaignStats', 0, -1, 'withscores']);
=> [
     "Campaign:002" => "2",
     "Campaign:003" => "2",
     "Campaign:001" => "4",
   ]
>>>

And simply by changing the Key to incorporate dates / times you can even break it down as in.

>>> Redis::command('zincrby', ['sset:CampaignStats' .  date('Ymd:H'), 1, 'Campaign:003']);

Now we can have a breakdown by Hour!

09 Nov
2 years ago

MarkLL left a reply on Count Number Of Items In Queue That Match Specific Rules? $10 For Solution

Hi @pmx , I would recommend that you utilize the Sorted Sets if you want these types of stats.

So where ever you have your LPUSH (or RPUSH) add another one say:

Redis::connection()->command('zincrby', ['sset:CampaignStats', '1', 'CampaignID']);

Then you have all sorts of possibilities. see http://redis.io/commands#sorted_set

The Order of the Sorted Set is basically controlled by the count/occurrence of each CampaignID. If you add Date info into the Key, say year-month you can even do some analysis across time in regard to the occurrences of the various CampaignID's

18 Oct
2 years ago

MarkLL left a reply on Ho Can I Display Date Time With Carbon In My Local Time ?

Hi @majacirkova see if the answer to this question helps... http://stackoverflow.com/questions/16525617/how-to-detect-users-timezone

tl;dr; If you Must do it in your php code, you need the browser to tell you where it is. It's often easier to use UTC time and convert it in the browser with JS.

14 Oct
2 years ago

MarkLL left a reply on Get Data On Multiple Tables Grouped By Hours

Hey @Estev this is the perfect use case for Redis :)

Where ever in your code you want to increment the various stats add the following:

for visits I would use:
\Redis::command('zincrby', ['sset:stats:' . date('Ymd:H'), 1, 'visits']);
For a Click:
\Redis::command('zincrby', ['sset:stats:' . date('Ymd:H'), 1, 'click']);
For a Sale:
\Redis::command('zincrby', ['sset:stats:' . date('Ymd:H'), 1, 'sales']);

Then when you want the info just use the following:

Redis::command('zrange', ['sset:stats:20161014:10', 0, -1, 'withscores']);

Here is a dump from a quick play in Tinker:

>>> use \Redis;
=> null
>>> Redis::command('zincrby', ['sset:stats:' . date('Ymd:H'), 1, 'visits']);
=> "1"
>>> Redis::command('zincrby', ['sset:stats:' . date('Ymd:H'), 1, 'visits']);
=> "2"
>>> Redis::command('zincrby', ['sset:stats:' . date('Ymd:H'), 1, 'visits']);
=> "3"
>>> Redis::command('zincrby', ['sset:stats:' . date('Ymd:H'), 1, 'click']);
=> "1"
>>> Redis::command('zincrby', ['sset:stats:' . date('Ymd:H'), 1, 'click']);
=> "2"
>>> Redis::command('zincrby', ['sset:stats:' . date('Ymd:H'), 1, 'click']);
=> "3"
>>> Redis::command('zincrby', ['sset:stats:' . date('Ymd:H'), 1, 'visits']);
=> "4"
>>> Redis::command('zincrby', ['sset:stats:' . date('Ymd:H'), 1, 'visits']);
=> "5"
>>> Redis::command('zincrby', ['sset:stats:' . date('Ymd:H'), 1, 'sales']);
=> "1"
>>> Redis::command('zrange', ['sset:stats:' . date('Ymd:H'), 0, -1]);
=> [
     "sales",
     "click",
     "visits",
   ]
>>> Redis::command('zrange', ['sset:stats:' . date('Ymd:H'), 0, -1, 'withscores']);
=> [
     "sales" => "1",
     "click" => "3",
     "visits" => "5",
   ]
>>>

Advantages:

  1. Lighting fast
  2. Easy to implement
  3. Doesn't break existing functionality.

You can leave them around as long as you like and you will have instant access to past stats as well as real time (e.g. by using the zrange command with the current date / hour). As I said, this is a perfect use case for adding Redis to your stack.

13 Sep
2 years ago

MarkLL left a reply on Model Observer Problem

Hi @impbob , The User Model is referenced in the following files (in 5.3):

app\Http\Controllers\Auth\RegisterController.php
config\auth.php
config\services.php
database\factories\ModelFactory.php

Change the references to App\Models\User:class in these files and run the composer dumpautoload command again.

You should see a reference to the correct file location in the following files generated by composer.

vendor\composer\autoload_classmap.php
vendor\composer\autoload_static.php

Also make sure that the path to the namespace App\Models is app\Models - e.g. with a capital M else the PSR4 auto loading will fail.

10 Jun
2 years ago

MarkLL left a reply on SPAM Protection?

LOL, I just flagged 3 posts in this very thread... Maybe a few moderators are required?

20 May
2 years ago

MarkLL left a reply on Class Not Found On Shared Hosting Version

@jakegroves I would say it's because you were developing on Windows which is not case sensitive versus a Linux server which is... :)

19 May
2 years ago

MarkLL left a reply on Class Not Found On Shared Hosting Version

@jakegroves check the case for the "library" folder. You namespace indicate it should be Library and not library... e.g. it case sensitive.

MarkLL left a reply on Class Not Found On Shared Hosting Version

What Namespace did you use in MyFunctions ? Looking at the location (/app/library/) the namespace should be App\library.

In the blade file you should reference it via the Namespace not the physical location. so it should be something like \App\library\MyFunctions::lessons(...).

17 May
2 years ago

MarkLL left a reply on Laravel Doesn't Work In Facebook Tab

Hi @MarvinVK di you account for the Facebook initial request?

When a user selects your Page Tab, their browser will send a HTTP POST request to your app's Secure Page Tab URL. This request will contain a Signed Request in the signed_request parameter with fields you can use to customise the content returned to the user.

This was taken from here

16 May
2 years ago

MarkLL left a reply on Testing On Windows - Bat File Tip

@Prez I noticed you disabled color. Personally I installed ansicon and copied ansicon.exe, ANSI32.dll and ANSI64.dll into c:\bin and created ansiOn.cmd

@%~dp0ansicon.exe -p

now in my command window, I simply run ansiOn.cmd and I actually get to enjoy the color :)

MarkLL left a reply on Testing On Windows - Bat File Tip

Hey @Prez Here's how I do it...

  1. Install the phpunit.phar file into c:\bin or whatever folder you happen to have in your path and here is the matching phpunit.bat batch file.
@php "%~dp0phpunit.phar" %*

It elegantly loads the .phar file using the current location of the batch file as the path to the .phar file without echo and accepting any parameters.

What the hey... :) here is my Composer cersion:

  1. Install the composer.phar file into c:\bin or whatever folder you happen to have in your path and here is the matching composer.bat batch file.
@php "%~dp0composer.phar" %*

and here is the php.cmd file that runs it all...

@set phpPath=c:\pathToManyPHPVersions\php7.0.5nts
@%phpPath%\php.exe -c %phpPath%\php.ini %*

When I download a new version of php, I simple adjust the path and that's it.

30 Apr
2 years ago

MarkLL left a reply on Lumen - Inconsistent Behaviour With GET Request

Hi @sunny_jay_jay try changing ... public function groupItems($id, Request $request) to public function groupItems($group, Request $request) or change the deinition in you route file for your groupitems route to use $id instead of $group

right now there is a mismatch...

28 Apr
2 years ago

MarkLL left a reply on Can PHP / Laravel Write To Any Folder?

Hi @davestewart - Yes it is possible to do what you want. I installed laraveldaily/quickadmin and it creates controllers, models and views etc. But as mentioned you may need to adjust the rights to the folders you are writing to in a linux environment...

27 Apr
2 years ago

MarkLL left a reply on Laravel Job Won't Get Called

@jaheller did you see my other response? Basically your Job class has be set up for Queueing because of ...

use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;

class SendReminderEmail extends Job implements SelfHandling, ShouldQueue
{
    use InteractsWithQueue, SerializesModels;

So you need to ensure that the queue is set to sync, or simply remove the Queue references in your class.. for example:

<?php

namespace App\Jobs;

use App\Jobs\Job;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Bus\SelfHandling;
use Illuminate\Contracts\Queue\ShouldQueue;
use Log;

class SendReminderEmail extends Job implements SelfHandling
{
    use SerializesModels;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct()
    {
        Log::info('const call');
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        Log::info('job call');
        //
    }
}

Something like that ...