laravelyv

laravelyv

Member Since 1 Year Ago

Experience Points
230
Total
Experience

4,770 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
0
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.

Level 1
230 XP
May
08
5 months ago
Activity icon

Replied to Sending Mail With Attachments In Laravel 5.7

I have changed my controller method with the mail sending feature and still the mail is not attaching attachments.

$objDemo = new \stdClass(); $objDemo->from = '[email protected]'; $objDemo->name = $request->name; $objDemo->company = $request->company; $objDemo->date = date('Y-m-d h:i:s'); $objDemo->position = $request->position; $objDemo->comments = $request->message; $objDemo->subject ='TypeFocus: Thank-you email'; $objDemo->action ='Write Thank You Mail'; $attachments = array(); if(isset($request->checkvals) && !empty($request->checkvals)) { $check_values = $request->checkvals; foreach ($check_values as $val) { //$file_value[] = public_path() .'/user_files/'.$val; $attachments[] = [ 'file' => public_path() .'/user_files/'.$val, 'options' => [ 'mime' => '', 'as' => 'docs' ] ]; } } // if(!empty($file_value)){ // $objDemo->attach(implode(",",$file_value),['as' => 'display', 'mime' => $mime]); // } Mail::to($to)->send(new Thankyou($objDemo,$attachments));

Activity icon

Replied to Sending Mail With Attachments In Laravel 5.7

Someone please help me to resolve this. Thanks.

Activity icon

Started a new conversation Sending Mail With Attachments In Laravel 5.7

I am submitting a form and selecting the attachments from the list of files. In my controller I am sending the mail like below.

in my controller method

$to = $request->email; if ($to!="") { $objDemo = new \stdClass(); $objDemo->from = '[email protected]'; $objDemo->name = $request->name; $objDemo->company = $request->company; $objDemo->date = date('Y-m-d h:i:s'); $objDemo->position = $request->position; $objDemo->comments = $request->message; $objDemo->subject ='TypeFocus: Thank-you email'; $objDemo->action ='Write Thank You Mail'; $file_value = array(); if(isset($request->checkvals) && !empty($request->checkvals)) { $check_values = $request->checkvals; foreach ($check_values as $val) { $file_value[] = public_path() .'/user_files/'.$val; } } if(!empty($file_value)){ $objDemo->attach(implode(",",$file_value),['as' => 'display', 'mime' => $mime]); } Mail::to($to)->send(new Thankyou($objDemo));

Also in my app mail php I have created like this.

public function build() {

    return $this->view('emails.thankyou_email')
    ->with([

    ]);
   
}

resources/views/emails i have created the view like this.

@if($thankyou->action=='Write Thank You Mail')

 

NOTE: to reply to the sender of this email, you have to use their email address, not "[email protected]"

 

Name: {{$thankyou->name}}

Company: {{$thankyou->company}}

Position: {{$thankyou->position}}

Date:{{$thankyou->date}}

Message: {{$thankyou->comments}}

TypeFocus Careers Program.

@endif

Now only added the attachment feature in my controller method and I am getting an error - Call to undefined method stdClass::attach()

Can someone please help me to resolve the issue. If I remove the attachment code from the controller method the mail is working fine. I need to attach the selected files in my mail. Please help me.

Oct
14
1 year ago
Activity icon

Replied to 405 Error

I have changed the resource option from the route file and gave proper function URLs in the web.php. Still all ajax call in my edit page is going wrong.

I gave this URL - http://127.0.0.1:8000/clients/generatecode1

But the call is going to http://127.0.0.1:8000/clients/edit/generatecode1

Someone please help me. Thanks.

Oct
13
1 year ago
Activity icon

Replied to 405 Error

My add/edit feature is working based on this route - Route::resource('clients','Admin\ClientController');

There is no separate route for add and edit.

Can someone help me to resolve the issue? Thanks.

Activity icon

Replied to 405 Error

These are the routes for clients in my web.php

Route::resource('clients','Admin\ClientController'); Route::any('clients1/{alphabet}', 'Admin\[email protected]')->name('alphabets'); Route::post('clients/generatecode','Admin\[email protected]_code'); Route::post('clients/generatecode1','Admin\[email protected]_code'); Route::post('clients/generatecontractdate','Admin\[email protected]_contract_date')->name('expiryDate'); Route::any('clients/export/{id}', 'Admin\[email protected]')->name('export'); Route::any('clients/csvexport', 'Admin\[email protected]')->name('clientexport'); Route::any('clients/deleteClient', 'Admin\[email protected]')->name('deleteClient');

Activity icon

Replied to 405 Error

I have corrected the above issue in my "add clients" page. But the same code I am using my in my edit code. User will reach this edit page by this link - {{ route('clients.edit',$client->id) }}.

In my web.php for calling ajax code I am using this route.

Route::post('clients/generatecontractdate','Admin\[email protected]_contract_date')->name('expiryDate');

This is successfully working with your above solution.

But in edit page I am using the same above URL in my ajax call.

When I debug the Network option in the browser the URL is going to

http://127.0.0.1:8000/clients/1/generatecode and I am getting 404 error page error. But I don't have any URL like this. No idea why its going to this URL. Someone please help me on this. Thanks.

Activity icon

Started a new conversation 405 Error

I hvae created a route in my laravel5.7 web.php as

Route::post('clients/generatecontractdate','Admin\[email protected]_contract_date')->name('expiryDate');

In my controller I created a Function

public function generate_contract_date() { echo "reached"; exit; }

When I call the above function through jquery ajax like below.

function generate_con_date() { var length_val=parseInt($('#ClientContractLength').val()); if(!isNaN(length_val)) { var startDate = $('#datepicker').val() loadUrl = "expiryDate"; $.post( loadUrl, {query_length_val: length_val,contract_date: startDate}, function (responseText){

           //alert(responseText);
           $("#ClientExpiryDate1").val(responseText);

         },
         "html"
         );
}

}

I am getting an error - POST http://127.0.0.1:8000/clients/generatecontractdate 405 (Method Not Allowed) in my jquery.

Can someone help me to reolve this. Thanks in advance.

Oct
07
1 year ago
Activity icon

Replied to Route Not Defined

Thanks. Ok. I will integrate it with jquery popup.

Activity icon

Replied to Route Not Defined

I have updated the post with the issue I am facing. Please check and comment it. Thanks.

Activity icon

Started a new conversation Route Not Defined

Hi, I have created a new laravel5.7 project. I have created a new controller named ProductController.php with all product actions functions.

Also created a a route in web.php as Route::resource('products','ProductController');

Created these blades under resources/views/products 1. layout 2. index 3. create 4. edit 5. remove and 6. show.

In the index.blade.php I have these three links for 1. show 2. edit 3. Delete like below.

Show Edit Delete

When I add the last link for Delete I am getting this error - "Route [products.remove] not defined. (View: /opt/lampp/htdocs/test1/resources/views/products/index.blade.php)

I have checked the php artisan route:list and its not showing the remove in the list. I have cleared all cache too.

I am new to Laravel and unable to rectify the issue. Can someone please help me on this? Thanks in advance.

Actually I need to show a confirmation pop up for delete the record. So I created this blade remove.blade.php. When user clicks on this link

Delete

It should open a pop up window (remove.blade.php). My remove.blade.php html is like below.

@extends('products.layout')

@section('content') @csrf @method('PUT')

     <div class="row">
        Are you sure, Do you want to delete this record?
        <div class="col-xs-12 col-sm-12 col-md-12 text-center">
          <button type="submit" class="btn btn-primary">Submit</button>
        </div>
    </div>

</form>

@endsection

When the user submits the button only the record should be deleted. For this functionality I have created the delete as a link in the index.blade.php and am getting the error.