andylord565

andylord565

Member Since 3 Years Ago

Experience Points 20,815
Experience Level 5

4,185 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 206
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

25 Feb
4 months ago

andylord565 left a reply on Mail After 5 Mins

Does anyone know how to use the get request on below: https://github.com/laravel/framework/blob/5.7/src/Illuminate/Queue/Jobs/DatabaseJobRecord.php

I think i can work with this if so.

andylord565 left a reply on Mail After 5 Mins

@bobbybouwmann i get how to dlete based on tag but how do i add the tag in the first place ?

andylord565 started a new conversation Mail After 5 Mins

I am looking to send a mail after 5 mins but if another mail is triggered then the previous email is deleted from the queue does anyone know the best way to do this ?

08 Feb
5 months ago

andylord565 left a reply on HTML 5 Video And Laravel

php artisan storage:link

creates a symbolic link more details found here: https://laravel.com/docs/5.7/filesystem

  <video src="{{ asset('storage/movie.mp4') }}" width="100%" height="100%" controls>
    </video>

The above should work

Try this:

  <video src="{{url('')}}/storage/movie.mp4" width="100%" height="100%" controls>
    </video>

or move the mp4 into the public folder.

05 Feb
5 months ago

andylord565 left a reply on Policies Help

Anyone having the same problem in the future managed to fix this:

public function __construct()
    {
       $this->middleware(function ($request, $next) {
            $user= Auth::user();
            $auth = $this->authorize('view', \App\groups::class, $user);
        });
    }

andylord565 started a new conversation Policies Help

The following works

public function index()
    {
        $this->authorize('view', groups::class);
       $groups = groups::orderBy('id', 'DESC')->get();
       return view('admin.groups.index', compact('groups'));
    }

The following does not:

public function __construct()
    {
       $auth = $this->authorize('view', App\groups::class);
       
    }

View file on App/Policies

public function view(User $user)
    {
        dd();
    }

How can i get it to work on a constructor rather then every function ?

26 Jan
5 months ago

andylord565 left a reply on Laravel - View Not Found

@programeranel please display your edit blade file to debug

andylord565 left a reply on Using Factories To Seed Sub-relations

@chrispage1

That would work i would recommend the table change however for relational and future work. Solution found is good though!

andylord565 left a reply on Validating A Request() With Key, Value Pairs

Hi @dawgonking try this

"scales"    => "required|integer|between:1.15",
"scales.*"  => "required|numeric|between:2,4",

andylord565 left a reply on Using Factories To Seed Sub-relations

@chrispage1

do something like this

factory(App\Asset::class, 1000)->create()->each(function ($asset) {
            factory(\App\AssetType::class, 1000)->create(['asset_id'=>$asset->id]);
            factory(\App\AssetModel::class, 1000)->create(['asset_id'=>$asset->id]);
        });

16 Jan
6 months ago

andylord565 left a reply on Read More In Paragraph

\Illuminate\Support\Str::words($value, $words = 100, $end = '...')
\Illuminate\Support\Str::limit($value, $limit = 100, $end = '...')

limit the words or the String and add a link on the end

04 Dec
7 months ago

andylord565 started a new conversation Not Ordering Correctly

i have this code

$products = products::orderBy('id', 'ASC')->with(['onedetail' => function ($q) {
                  $q->orderBy('price', 'DESC');
                }]);

$products= $products->paginate($page);

One detail i simply a connection to more details

public function onedetail()
     {
         return $this->hasOne('App\product_price_details', 'product_id', 'id');
     }

When it comes to the ordering it is coming out in a weird order not even close has anyone any idea how to fix this ?

27 Nov
7 months ago

andylord565 left a reply on File Not Found At Path With Maatwebsite/excel

Try this:

Excel::import(new ProductsImport, public_path('excel_products/'.$excel->name));

23 Nov
8 months ago

andylord565 started a new conversation Foundation, Bootstrap Or Other

I use bootstrap a lot unless fully customizing sites from scratch but looking for alternatives and come across foundation.

My question is what do you use and recommend for a CSS framework for quick medium and large sites?

03 Nov
8 months ago

andylord565 left a reply on Method Links Does Not Exist In Laravel 5.6 App?

on SearchController change $vehicles = Vehicle::get(); to $vehicles = Vehicle::paginate();

also

``$vehicles = Vehicle::search($request->get('search'))->paginate()->sort(function ($a, $b) { if ($a->adtype !== $b->adtype) { return $b->adtype - $a->adtype; }

    return $a->adtype
        ? ($a->updated_at->gt($b->updated_at) ? -1 : 1)
        : ($a->created_at->gt($b->created_at) ? -1 : 1);
});  

``

01 Nov
8 months ago

andylord565 left a reply on Why Did Not Laravel 5.6 Active Menu Item Highlight Using Request?

@Analmax

For 5.6 it is the following

{{ Request::is('products/*') ? 'active' : '' }} or {{ Request::is('products') ? 'active' : '' }}

31 Oct
8 months ago

andylord565 left a reply on Why Did Not Laravel 5.6 Active Menu Item Highlight Using Request?

Use {{ Route::is('products.*') ? 'active' : null }}

14 Oct
9 months ago

andylord565 left a reply on Is There A Way To Keep Page From Expiring

You can change the timeout in config\session.php

although i would not change this to something to big for security.

25 Sep
9 months ago

andylord565 left a reply on Routing Active

Just to update this for future i found that this is for 5.6: {{ Request::is('news/*') ? 'active' : '' }}

11 Sep
10 months ago

andylord565 left a reply on Laravel Collection Ordering Bring To Front

@Mo7sin yes exactly but with values already in the collection is there a way to prepend results based on a where for example

andylord565 started a new conversation Laravel Collection Ordering Bring To Front

How would one bring certain results in a collection to the front of the collection say if field A = 0 or A = 1 ?

27 Jul
11 months ago

andylord565 left a reply on Laravel Upload Image Validation Failed | Hacking Threat

change 'image' => 'mimetypes:jpeg,png,jpg', to 'image' => 'mime:jpeg,png,jpg'

That should work

01 Jun
1 year ago

andylord565 left a reply on Routing Active

Neither of these work and route is not named.

andylord565 started a new conversation Routing Active

In Laravel 5.2 this is working: {{ Route::is('mylink.*') ? 'active' : null }} In Laravel 5.5/5.6 this is now working does anyone know why or a way to fix ?

15 Mar
1 year ago

andylord565 left a reply on Laravel And Git

Update i just tried a fresh install of Laravel and route:list is working fine although only a few routes leading me to believe something is wrong on Laravels side

andylord565 left a reply on Laravel And Git

@Sergiu17 Its already set to xterm-256color This has no affect I was using version 2.16.2 and now tried version 2.10 as i just recently upgraded but this did not fix it unfortunatly

14 Mar
1 year ago

andylord565 left a reply on Laravel And Git

Reinstalling Git has not fixed this issue anyone any ideas ?

andylord565 left a reply on Laravel And Git

Using another terminal is working totally fine and the same setup and project on another computer this is not happening weird.

andylord565 left a reply on Laravel And Git

@Sergiu17 Still the same with that command

andylord565 started a new conversation Laravel And Git

Has anyone ever come across this before only happens in Git and when doing route:list? https://ibb.co/hwgTVH

13 Mar
1 year ago

andylord565 started a new conversation Mailgun Sending

Emails are not sending My Env is Digital ocean. What i have done/checked: -- added config/services mailgun -- changed .env to mailgun -- checked that guzzle is working

No errors occur when doing the following

Route::get('send_test_email', function(){ Mail::raw('Sending emails with Mailgun and Laravel is easy!', function($message) { $message->subject('Mailgun and Laravel check'); $message->from('[email protected]', 'Website Name'); $message->to('[email protected]'); }); }); No error logs are stored in var and laravel.log is empty. On Mailguns side it is showing no emails coming through any ideas what could be going wrong ?

20 Aug
1 year ago

andylord565 started a new conversation Faker Random Image Size Width And Height

My Factory currently is:

$factory->define(App\gallery::class, function (Faker $faker) { return [ 'image' => $faker->randomElement(['150x350.png' ,'150x500.png', '350x150.png', '350x350.png', '500x150.png']),

];

}); I am after: $factory->define(App\gallery::class, function (Faker $faker) { return [ 'image' => $faker->randomElement(['150x350.png' ,'150x500.png', '350x150.png', '350x350.png', '500x150.png']), 'height' => heighthere, 'width' => widthhere, ]; });

But i the height and width need to match the randomElement size selected how can i do this ?

12 May
2 years ago

andylord565 left a reply on Laravel Compression

https://jsfiddle.net/vLah664a/ See link for my current htaccess

andylord565 left a reply on Laravel Compression

Below is my htaccess Options -MultiViews

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]


RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding

AddOutputFilterByType DEFLATE application/atom+xml application/javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-ttf application/xhtml+xml application/xml font/opentype image/svg+xml image/x-icon text/css text/html text/plain text/x-component text/xml

Header set X-UA-Compatible "IE=Edge,chrome=1"

mod_headers can't match by content-type, but we don't want to send this header on everything...

<FilesMatch ".(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|oex|xpi|safariextz|vcf)$" > Header unset X-UA-Compatible

# mod_headers, y u no match by Content-Type?! <FilesMatch ".(gif|png|jpe?g|svg|svgz|ico|webp)$"> SetEnvIf Origin ":" IS_CORS Header set Access-Control-Allow-Origin "*" env=IS_CORS

<FilesMatch ".(ttf|ttc|otf|eot|woff|font.css)$"> Header set Access-Control-Allow-Origin "*"

<FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4)$"> Header set Cache-Control "public"

ExpiresActive on

ExpiresDefault "access plus 1 month"

ExpiresByType text/cache-manifest "access plus 0 seconds"

ExpiresByType text/html "access plus 0 seconds"

ExpiresByType text/xml "access plus 0 seconds" ExpiresByType application/xml "access plus 0 seconds" ExpiresByType application/json "access plus 0 seconds"

ExpiresByType application/rss+xml "access plus 1 hour" ExpiresByType application/atom+xml "access plus 1 hour"

ExpiresByType image/x-icon "access plus 1 week"

ExpiresByType image/gif "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType video/ogg "access plus 1 month" ExpiresByType audio/ogg "access plus 1 month" ExpiresByType video/mp4 "access plus 1 month" ExpiresByType video/webm "access plus 1 month"

ExpiresByType text/x-component "access plus 1 month"

ExpiresByType application/x-font-ttf "access plus 1 month" ExpiresByType font/opentype "access plus 1 month" ExpiresByType application/x-font-woff "access plus 1 month" ExpiresByType image/svg+xml "access plus 1 month" ExpiresByType application/vnd.ms-fontobject "access plus 1 month"

ExpiresByType text/css "access plus 1 year" ExpiresByType application/javascript "access plus 1 year"

andylord565 started a new conversation Laravel Compression

Compressing http://example.co.uk/ could save 7.2KiB (70% reduction).

I am running compression through htaccess I have added all the usual htaccess rules however the actual page it is on is not compressing anyone know why this is?

22 Nov
2 years ago

andylord565 left a reply on Laravel Relationship Not Working?

I figured this out and the controller had to be more specific like this: $cart = carttemp::where('session_id', '=', $session_id)->with('getproducts')->get();

andylord565 left a reply on Laravel Relationship Not Working?

Also it just came to mind but could it be something to with my controller?

this is how i am getting the cart: $cart = DB::table('carttemp')->where('session_id', '=', $session_id)->get();

andylord565 left a reply on Laravel Relationship Not Working?

could it be in the way i have done the databases?

carttemp: id, products_id, session_id, quantity

products id, name etc

andylord565 left a reply on Laravel Relationship Not Working?

yes cart object is firing just fine

andylord565 started a new conversation Laravel Relationship Not Working?

Why is my relationship not working? First time i have actually tried doing this so little confusing basically i need to foreach products from the cart this is what i have:

@foreach ($cart->getproducts as $carttemp) product info goes here @endforeach

This is on my carttemp model:

public function getproducts() { return $this->belongsToMany('App\products', 'products', 'products_id', 'id'); } This is on products Model: public function carttemp() { return $this->hasMany('App\carttemp'); }

Why is it bringing back a error: Trying to get property of non-object

08 Nov
2 years ago

andylord565 left a reply on Laravel 5.2 Errors Not Showing And Route Model Binding

So rather then messing around with this i just reinstalled a fresh laravel and added all the content back to it and it fixed it no idea what the cause was

andylord565 started a new conversation Laravel 5.2 Errors Not Showing And Route Model Binding

so recently i upgraded a build to 5.2 which was great however now what i get is that pages no longer show the errors page or a nice sorry page anymore just a blank page on top of this i am trying to add a route model binding:

In route service provider i added this: $router->model('slug', 'App\blog');

and in my route this: Route::get('/blog/{slug}', '[email protected]');

However i am just getting a white page and on the console i can see the error 404 so little confused as to how to fixed this at the moment anyone can help here please?

09 Oct
2 years ago

andylord565 left a reply on Shared Hosting Request

Figured it out http should be Http

andylord565 started a new conversation Shared Hosting Request

Anyone have any idea why my request would not work on shared hosting:

ReflectionException in Route.php line 286: Class App\http\Requests\blogRequest does not exist

I checked the file location and it is in place

23 Aug
2 years ago

andylord565 started a new conversation Vue Hot Reloading

Anyone have any tutorials on Hot reloading in Vue, going through the documents and wishing there was a video i could follow by Jeffery

31 Mar
3 years ago

andylord565 left a reply on Project Flyer No Refresh

"If you want to upload then display. Return all images in the API post request. On success use JavaScript to display the images/replace image list area or refresh the page."

@jekinney as i am not sure how to do this do you have an example please?

30 Mar
3 years ago

andylord565 left a reply on Project Flyer No Refresh

anyone can help with this?

andylord565 started a new conversation Project Flyer No Refresh

Just been watching this series again as i remembered hearing in this series that after uploading it would show the thumbnails without refreshing and i was interested to see how Jeffery did this but i see this has not been done as of yet in the series has anyone managed to do this and have an example ?

26 Mar
3 years ago

andylord565 left a reply on New Design...

Just seen the new design, not a fan of having to click more from the homepage to find what i want, can you bring back some kind of menu on the homepage please!

22 Mar
3 years ago

andylord565 started a new conversation Session Logins

So basically i just thought i had found a security flaw in a website being developer but not sure basically when logged in you set a session for the logged in user as the username now if someone was to set the same session on in a similar way on a different website that session would be set and they would be logged in on both sites correct ? does that make sense if not please ask

so basically what is the best way of stopping this or how else would you do it?