Tangente

Tangente

Member Since 5 Years Ago

Colorado Springs

Soldier in US Army at Colorado Springs

Experience Points 25,940
Experience Level 6

4,060 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 302
Lessons
Completed
Best Reply Awards 16
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.

30 May
3 weeks ago

Tangente left a reply on HTTP Error Occurred During File Upload (404: File Not Found).

by the way, I do not see your input file in the html code.

It should be like this:


<input type="file" name="upload">

Tangente left a reply on How To Implement Payments Between Users, Patreon Like...

Were you able to find the answer to this? It's a good question

29 May
4 weeks ago

Tangente started a new conversation PHPUnit With Laravel 5.8

Trying to follow along https://laracasts.com/series/phpunit-testing-in-laravel series, with Laravel 5.8 but so far it's a nightmare. Functions like $this->visit(); nolonger exist. I found online I can use laravel/browser-kit-testing (v5.1.2), but this doesn't seem to work as well, complaining that:

ExampleTest contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Laravel\BrowserKitTesting\TestCase::createApplication)

Which I can obviously do, but that makes me modify that vendor code, and is not a good approach.

Any ideas?

Thank you

20 May
1 month ago

Tangente left a reply on Password Updating But Not Able To Login With New Password

Can you share your log in function?

19 Mar
3 months ago

Tangente left a reply on Issue Trying To Calculate Average With Javascript Method

Issue is here:

for(var i=0; i<= discountReviews.length; i++)

It should be

 for(var i=0; i<= discountReviews.length; i++)

It is failing on the last iteration

Tangente left a reply on How Can I Include Params On All Blades?

Instead of

Use App\Http\Controllers

Do instead

Use App\Http\Controllers\AssetsController

That way it knows where to find it

08 Mar
3 months ago

Tangente left a reply on Data From A Table Where Column 1 Equals To Column 2 Of The Same Row


Posts::whereRaw("name = author")->get();

Tangente left a reply on Syntax Error, Unexpected '{'

I don’t know how we didn’t catch that ?‍♂️

Tangente left a reply on C# Post Method Works On Localhost But Not On Shared Host Ask Question

The methodNotAllowed exception (405) indicates that a route doesn't exist for the HTTP method you are requesting. If that routes exist and works well on localhost, then your server (https://example.com) is not routing correctly. Which means your .htaccess is not behaving correctly

I would do all troubleshooting on .htaccess file. I see it looks a little different from what ships out with laravel.

Documentation says “ If the .htaccess file that ships with Laravel does not work with your Apache installation, try this one:“

Options +FollowSymLinks
RewriteEngine On

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

Tangente left a reply on How Many Droplets/DB Droplets Are Behind Laracasts?

Good question. I think only @jeffreyWay can answer that

Tangente left a reply on Making Files Downloadable Only After Purchase

In database, have a path to full mp3, just like you do for the sample one. Once the customer buys that ID, then redirect them to the page with full path.

Yes, stripe can handle all payment stuff, and once the payment succeeds then redirect them to page with full path of mo3

Tangente left a reply on Looking For Tutor/mentor Or Studybuddy

Good question. Are you going to pay them or it’s just a free tutor?

Tangente left a reply on Syntax Error, Unexpected '{'

Try this:

public function addProduct(Request $request)
    {
        if($request->isMethod('post'))
          {
            $data = $request->all();
            //echo "<pre>"; print_r($data); die;
            if(empty($data(['cateogry_id']))
           {
                return redirect()->back()->with('flash_message_error','Under Category is mssing');
            }
}
}
07 Mar
3 months ago

Tangente left a reply on Laravel Confirm Delete In An Alert In My View

Something like this...:


<a class="btn btn-danger" onclick="return confirm('Are you sure?')" href="{{route('Your-delete-route', $user->id)}}"></a>

Tangente left a reply on Conditionally Bind Implementation To Interfaces

I would do this. After log in, do app(“MyClass”)= new MyClass();

I know that is not binding to interface as you want, but wouldn’t this work???

06 Mar
3 months ago

Tangente left a reply on Attach() On Custom BelongsToMany-Model

What’s the name of table that the model “Membership” is using?

I may be wrong, but I think if you are not specifying it’s name, Laravel will default to both model names together, and hence complaining that table folder_user doesn’t exist.

Make sure that in the model Membership you have this: protected $table = “membership'; (or however you choose to call it), that way laravel doesn’t assume table name to be folder_user

Tangente left a reply on UUID And Pivot Tables

I can’t follow that link, it goes to error 404. However...

That is definitely crashing because of your table structure. That trait simply checks, if you don’t have a primary key value set, then generates UUID and assigns to it. That being said, I think your tables has extra field “id “ that is required, but you are not passing a value to it.

Quick solution:

  1. make that “id” auto increment, that way you don’t have to worry about it, or
  2. make it not required or
  3. drop that column from pivot table

Unless I’m wrong and doesn’t have “id” column

Tangente left a reply on Submit Form With Sweet Alert

Sorry, I can’t test this on iPad. Btw, isn’t it supposed to be a comma instead of .”then” or it doesn’t matter? I was just reading about .swal, and it always use this “,function()”, not “.then(function()”, so that made me wonder if it matters. What happens if you change it to this:

jQuery(document).ready(function(){ jQuery('button#verifyDoc').on('click', function(event ){ event.preventDefault(); swal({ title: "", text: "...", type: "info", showCancelButton: true, buttonsStyling: true, confirmButtonText: "ok", cancelButtonText: "cancel", }, function(isConfirm){ if(isConfirm){ jQuery("#verifyDocForm").submit(); } }); }); });

Tangente left a reply on Please Could Someone Help Me With This File Upload Problem

@riaanv1987 you getting that error, syntax error, because he forgot a parentheses here

if(isset($filenames['aandeel_pop'])

Change that to

if(isset($filenames['aandeel_pop']))

Tangente left a reply on Submit Form With Sweet Alert

In that case, I think the problem is how you are making JQuery selection. That jquery code is not being executed. Debug like this:

jQuery('button#verifyDoc').on('click', function(event ){ alert(“hello there “);

And try. If the alert doesn’t go, Then I am right.

In your html, change the button to this < input type=“button” id =“verifyDoc” .......

Then jquery, do this instead

jQuery('#verifyDoc').on('click', function(event ){ event.pre entDefault();

Tangente left a reply on Submit Form With Sweet Alert

You have to tell the event to prevent default action. By clicking, default is submitting. So pass event in that function, and add this:

. click(function( event ) { //pass the event in there

// then add

event.preventDefault();

Something like that

Tangente left a reply on Completion Percentage Based On Time, Not On Quantity

I personally don’t care how far I’m in series in terms of percentage, but I guess some people really care about it.

I guess @JeffreyWay should look into it.

I do agree with you though, it’s not accurate. You can watch 1 quick introduction video while the other one is long ass 30 minutes and it tells you you are 50% done while it’s not even close.

Tangente left a reply on How To Get The Accordion To Open Or Close Depending If There Is An Error

This is how I would do this. Create another partial, and have a conditional JavaScript . I’m assuming you are using JQuerry accordion? Anyhow, in my accordion.blade.php, I’d have this:

@ if($errors->business_errors->any()) < script type=“javascript >

$( ".accordion" ).accordion( "option", "active", 1 ); // your selector class is called “accordion” in the code. < /script >

@ endif

Then in your blade just include it anywhere include(‘accordion’) Something like that.

This is probably not the most elegant solution to this because we are mixing javascript with php code, but oh well, it should do if you go that route

:)

Tangente left a reply on 400 Bad Request In Method DELETE And PATCH

Correct me if I am wrong, but in theory it shouldn’t be working in localhost too. Ajax has only 2 types, POST and GET. Those laravel methods, PATCH, DELETE are handled by doing what’s called Method Spoofing behind the scene. Anyhow, for Ajax try this:

< input type="hidden" name="_method" value="PATCH" > or < input type="hidden" name="_method" value="DELETE" > and see if that works. Sorry I can’t try it on iPad :)

05 Mar
3 months ago

Tangente left a reply on Select Users Based On User ID

There are a few ways you can solve this.

What I would do is only pass the $users arrays. So, in controller, check If the $user has ID=1, then get users whose ID type is 2. Like, $users=User::where(‘typeID’,1); if your user type ID is 2, then make $users=User::where(‘TypeID’,2);

Then pass $users variable to the view.

In the view, get rid of @elseif entirely.

Tangente left a reply on Which Technology Is Used Behind The Following Website?

It’s not easy to tell all technology behind those websites, but there is a tool that gives most of information you need regarding the website. Go to “https://www.builtwith.com” and enter the website you need and they can you a fair amount of technology being used. Not everything, but a lot of it.

For example, https://builtwith.com/biteable.com says that website is built in WordPress intent management, etc.

Good luck

Tangente left a reply on 419 Error Found When Deploy App To Product Server

Error 419 is usually the issue of CSRF. If it’s working on local server but not on production, make sure sessions are being set correctly. Also, sometimes the issue is that your permission is not set correctly, therefore no “write “ permission. Try and change permission to 777 on production, storage folder. Like this:

chmod -R 777 storage

Tangente left a reply on Saving Created Image

You can save the image using the same function, but passing second parameter of path where you want the image to be saved at. Something like this:

$path = "storage/app/public/alkali/myImage.png"; imagepng($my_img, $path);//by providing the path, it saves it to file instead of displaying it

Tangente left a reply on Select Users Based On User ID

What’s not working? According to your code, if you are passing $users array, then make a drop down, otherwise if you have just one user, make a text field. It seems like this logic would work, as long as you are passing those variables to blade.

What’s the results are you getting?

01 Mar
3 months ago

Tangente left a reply on Searching Multiple Fields Over Multiple Tables

@sabbir345 , what do you mean by not working properly. I am assuming you have two variables, $name=$request("name"); $prescription=$request("prescription"); or something like that and then you do the queries?

28 Feb
3 months ago

Tangente left a reply on Callback / Anonymous Functions

To be honest, I don’t see an issue either. Can you do a little debugging? Put dd($query); right before returning it so we know where the issue is happening at?

Tangente left a reply on Displaying Image

Something like this:

I’d}}.”.jpg”>

Tangente left a reply on Why Can't Set Custom Message With Abort()

Make sure your error views (404.blade.php, or 500.blade.php) were not modified. 404.blade.php should look like this for instance:

https://github.com/Laravel-Backpack/Base/blob/master/src/resources/error_views/404.blade.php

Tangente left a reply on Form Doesn't Get Values

For each input, you have to give it a name parameter. Like

08 Jan
5 months ago

Tangente left a reply on Migration Refresh: Cannot Delete Or Update A Parent Row: A Foreign Key Constraint Fails

Reverse the order of drop, like this:

public function down() { Schema::dropIfExists('posts');

    Schema::dropIfExists('postcategories');
    
}

;

Tangente left a reply on Zip Request Files

save those files then before zipping them, something like this:

 $files = $request->file('files');

$savedFiles = {}; Foreach ($files as $file) { $extension = $file->getClientOriginalExtension(); $storage = '/app/files/'; $fileName = $storage . str_random(100) . $file->getFilename() . '.' . $extension; $savedFiles[]=$fileName; $file->move(storage_path() . $storage, $fileName);

        }

Later on then zip them

Zipper::make('storage-path-you-have/user-files.zip')->add($savedFiles)->close();

07 Jan
5 months ago

Tangente left a reply on Zip Request Files

  1. get files from request:

$files=$request[“files”];// this is an array of files

  1. zip the files and move zip to storage

Zipper::make('storage-path-you-have/user-files.zip')->add($files)->close();

//now save that zip file to database for whoever will need to download it.

What couldn’t work when you tried that method?

Tangente left a reply on Update One To Many

What does this return?

$invoice->invoiceitem()

Because your loop keeps updating that on every iteration

Tangente left a reply on Update Some Attributes And Do Not Fire Saving Events

I may be wrong, but I think those model events will always fire, like saving, creating, etc . You can’t stop them from firing, but you can decide on how you listen to them and handle them though. I suggest you add the logic in the handler method, like

Public function saving(Product $product) { If( $product->estimated_fee ) { //do your code here }

Tangente left a reply on Update One To Many

What’s wrong with your update function? It doesn’t work or you need a better solution? Usually sync functions works better for one to many relationships, like this:

$invoice -> reports() -> sync($request -> reports);

Something like that

06 Jan
5 months ago

Tangente left a reply on Universal (database) GroupBy Formatted Date

I answered a question like this earlier

Try this method:

use Carbon\Carbon; $latest = Site::query() ->with('upvotes') ->orderBy('created_at', 'DESC') ->get() ->groupBy(function($date) { return Carbon::parse($date->created_at)->format('D'); // grouping by days

});

I would follow te same way as above

05 Jan
5 months ago

Tangente left a reply on Website Gets Messed Up On Update

sorry, it's hard to troubleshoot without having access to your dev. i would inspect the code (F12 on keyboard), and see why the production layout displays different in dev. it has to be issue with CSS files somewhere

btw, the only difference i see between the two is that the section that displays picture displays shorter than on production. does it function well as it does on production?

Tangente left a reply on Pulling Data From Table Based On ID

try this:

in controller, change this line to:

return view('profile', compact('validations', 'users', 'availability','profile'));//the profile has all the info you need for specific user, right? 
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-sm-4">
        <h2>View Profile - {{ $profile->name_first }} {{ $profile->name_last }}</h2>
        <ol class="breadcrumb">
            <li>
                <a href="{{ url('dashboard')}}">Users</a>
            </li>
 @foreach($users as $user)
            <li class="active">            
                <strong>{{ user->name_first }} {{ $user->name_last }}</strong>
            </li>
@endforeach
        </ol>
    </div>
</div>

Tangente left a reply on Zip Request Files

in nutshell, that links says this:

add zipper package

composer require chumper/zipper

then add it in service providers array

'providers' => [
        // ...
       'Chumper\Zipper\ZipperServiceProvider',
    ]

make alias of it in alias array

'aliases' => [
        // ...
        'Zipper' => 'Chumper\Zipper\Zipper',
    ]

make a function to create zip files

 public function create()
    {
        $files = base_path(); //here you can specify which files you want

        \Zipper::make(public_path('test.zip'))->add($files)->close();//
        return response()->download(public_path('test.zip'));
    }

when the user wants to download the file, follow same path:

  $Path = public_path('test.zip');
        \Zipper::make($Path)->extractTo('storagePath');

Tangente left a reply on Website Gets Messed Up On Update

Use browser’s dev tool and make sure all CSS files and JS files are present. It seems like some JS files may be missing

Tangente left a reply on How To Count Total Row Using Vue Js?

If that is an array, then you can use old php length function, like

{{data.length}}