Neven

Neven

Member Since 6 Months Ago

Le Mans

Experience Points 4,540
Experience Level 1

460 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 16
Lessons
Completed
Best Reply Awards 5
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.

23 Aug
3 weeks ago

Neven left a reply on Filtering On Pivot Values

Hi, try this

  • Question 1 :
$dps = dp::wherehas('listings.services', function ($q)  use ($service_id){ 
        $q->where('service_id',$service_id); //$service_id = wheels service id.
})->get()
  • Question 2 :
$dps = dp::wherehas('listings.services', function ($q)  use ($service_id,$filter){ 
        $q->where('service_id',$service_id) //$service_id = wheels service id.
        ->where('listing_service_value',$filter);
})->get()
22 Aug
4 weeks ago

Neven left a reply on How To Id Wise Download Document ?

Hi, with the attribute download ?

@foreach($document as $documents)
     <div class="col-lg-4">
         <a href="{{asset('training/document/'.$documents->doc_type)}}" download="path_to_the_document"> {{$documents->doc_type}</a>
      </div>
@endforeach

Neven left a reply on Mail Not Sending Emails With The Same Domain

Hi, try this in your .env

MAIL_DRIVER=smtp
MAIL_HOST=smtp.parkandfly.is   //here the change
MAIL_PORT=587
MAIL_USERNAME=username
MAIL_PASSWORD=password

and i think you can send multiple cc this way :

->cc('email-1','email-2')

this is the documentation : https://laravel.com/docs/5.8/mail#queueing-mail

but i personnaly use an "other method" :

$data = //my data or $request
Mail::send('emails.blade-vue', compact('data'), function ($message) use ($data) {
    $message->from('[email protected]', 'Title')
    ->to($data->email)
    ->bcc([email protected])
    ->subject('Subject of the mail');
});

Neven left a reply on Undefined Variable: $loop In @foreach

Yeah, why dont you use the $key of the @foreach loop ?

21 Aug
4 weeks ago

Neven left a reply on Using For Loops Inside Laravel Observer

You're welcome :)

20 Aug
4 weeks ago

Neven left a reply on Request To Retrieve Attributes Related To A Product

Hi, im not sure I understand everything.

  • Your tables and relations : ok *the famillies collection : not ok

What do you want, only the families where all the attributes related is used by all the product ? So we exclude famillies with attributed unused ?

So, a collection of all the attibutes used, then all the families of this attributes ?

If im not wrong, if you have one Family (color) and two attributes (Red and Green) and two product, the first red and green, the second just green. We get the color family with a collection of attributes the unique value will be green ? because the second product is not red

Neven left a reply on Using For Loops Inside Laravel Observer

Hi, if the problem came from the for loop, its maybe related to the addMinutes() and addSecond(). Have you try to print the $oredereAt for each loop ?

For me you need to parse() the $order->created_at for adding time with Carbon:: methods.

And why dont compare the $order->created_at with Carbon::now() ?

Neven left a reply on Grouped Vertical Chart In Laravel

Like that : https://www.chartjs.org/docs/latest/charts/bar.html ? What do you want in X and Y axis ? have you the data ?

Neven left a reply on Grouped Vertical Chart In Laravel

If you have all the data and its the chart the problem try to work with this exemple : https://codepen.io/igpc/pen/oPXZEZ

If you need help to create the collection for the data of the chart, i will need more time :)

Neven left a reply on Upload Multiple Product Images

Hi, For this you need to add the parameter multiple on the input['type:file'] in your form for accept multiple files.

{{ Form::file('images[]',['class' =>'your-class','multiple']) }}

Then in your method store you will receive the files in $request->images as a collection. So you just need to work this collection of files as if you work with one image. But in a foreach loop.

foreach($request->images as $image){
    //bla bla bla
}

Neven left a reply on Email Verification 403 Invalid Signature If Time Expires

For the signature check out the docs here:

https://laravel.com/docs/5.7/urls#signed-urls

Is the email sent from the same host that you're accessing here? If the app key is different the signature wouldn't work because it couldn't decrypt the signature key.

source : https://laracasts.com/discuss/channels/laravel/403-invalid-signature-every-time-i-try-to-verify-email-in-laravel-57

Neven left a reply on Filtering On Pivot Values

Hi, your explication is a little confused, so i dont know if i understand everything. You have Users, DPS, Listings and Services

  • Users have one DPS
  • DPS have many Listings but Listings only one DPS
  • Listings have many Services and Services have many Listings
  • Listing_Service pivot table contain 4 more values.

And you search to create a collection of DPS with several conditions.

$dps = only DPS with (LISTINGS with (SERVICE or (SERVICE with pivot_value ) ) );

Its difficult to understand what you want, but with that i hope it will be much easier for the other members.

I dont understand the next part of your question, can you reformulate ? Thx

Neven left a reply on Grouped Vertical Chart In Laravel

Hi, can you use markdown for your code ? Write ``` the line before and after each part of your code.

exemple : it will be more easier to understand ! Thx

Neven left a reply on Method('Patch') And CSRF Token Appear In Page And Don't Work.

Hi, try this :

{{ csrf_field() }}
{{ method_field('PATCH') }}

Neven left a reply on Upload Image To Local And Path Recorded In Database

Hi,

public function store() 

I think you forget somethink like the parameters ?

Neven left a reply on Tried To Switch The Default Model Used By The Auth Scaffold But Now Registration Just Refreshes Instead Of Creating A New User.

If you debug step by step your project you will found the problem. 2 hours of search, thx.

$validator =  Validator::make($data, [
            'fname' => ['required', 'string', 'max:255'],
            'lname' => ['required', 'string', 'max:255'],
            'position' => ['required', 'string', 'max:255'],
            'email' => ['required', 'string', 'email', 'max:255', 'unique:employees'],
            'password' => ['required', 'string', 'min:8', 'confirmed'],
        ]);

It was the fName => fname

Tips : For an easy migration, insert this in the method boot() in Providers\AppServiceProvider

Schema::defaultStringLength(191);

Neven left a reply on Filter Mailing List While Importing It

Hi, Validator:: can take 'unique' as value :

'email' => 'required|email|unique:TableHere'

source : https://laravel.com/docs/5.8/validation

For the verification of the email : https://lubus.in/blog/adding-email-verification-in-laravel-5-3-app-149

19 Aug
1 month ago

Neven left a reply on Want To Convert Sql Query To Laravel

Something like that ?

$lat = $request->lat;
$lon = $request->lon;
$formula = 6371* acos ( cos ( radians(12.9166) ) * cos( radians( $lat ) ) * cos( radians( $lon ) - radians(77.6101) ) + sin ( radians(12.9166) ) * sin( radians( $lat ) );

$doctors = Doctor::whereraw($formula,'<', 5)->orderBy('distance')->pluck('id')->limit(20);

im not sure

01 Aug
1 month ago

Neven left a reply on Add A Div Every X Number If Items

Hi, In your foreach try using $loop->iterationwhich return the number of the current loop.

@if($loop->iteration % 4 == 0) 
  </div>
  <div class="">
@endif

With this you can close the currentdiv and open the next div .

Neven left a reply on Laravel Controller

@tykus the error is

 Method App\Http\Controllers\Admin\TbookingController::store does not exist.​ 

Neven left a reply on Laravel Controller

@alexa try the command php artisan route:list. You will obtain the list of all your routes. You have a store route for your User\TbookingController and for the Admin\TbookingController ?

Your problem is, your Route::post (store method) of your User\TbookingController is not use and its the Route::post of your Admin\TbookingController who is called but the store method in Admin\TbookingController doesn't exist. You have an error :)

Route::resource create all the routes for your controller but you don't need all of them. So dont write Route::resource but each route one by one. Six in total.

For User\TbookingController the routes GET (create) and POST (store). For Admin\TbookingController the routes GET (index), GET(edit), PUT(update), DELETE (destroy).

Neven left a reply on Laravel Controller

@tykus Exact, but i my opinion there are too many exception on his Route::ressource. There is not only the store method, so i proposed to cut the Route::ressource. And so it will be easeaier to read the route file for him/her.

I hope i dont make a mistake.

Cordially, Neven

Neven left a reply on Laravel Controller

Hi, Route::resource will create all the HTTP request type routes (POST, GET, PUT and DELETE) for index, create, store, update and destroy method on your Controller. If in your Admin\TbookingController dont have the store method, Laravel will return an error.

First, since you separate the HTTP request type in two Controllers, if i were you i will separate my routes and dont use Route::resource.

Secondly, if you choose to use Route::resource, you will need to create an empty store method in the Admin\TbookingController and place the Route::resource for User\TbookingController above the routes for the Admin\TbookingController in your routes file.

Personnaly i prefer the first one. I hope i have hepded, Good luck and good day,

Cordially, Neven

12 May
4 months ago

Neven left a reply on How To Show Image In View When Upload?

Hi, in the balise img the source file src="" must redirect to your image file. If your file is in /public/imgs/myfile.png and if in $employerimage->image is myfile.png

<img src="{{asset('/imgs/'.->image)}}">

I hope i helped :)

25 Apr
4 months ago

Neven left a reply on Rapid Controller (CRUD) Development For Laravel?

Hi, For create a RestFull controller you can use this command php artisan make:controller MyController --resource

This one will create your controller and your model php artisan make:controller MyController --resource --model=MyModel

In the controller the method index(), create(), store(), edit() ans destroy() will be create. But empty.

I dont think a package who create your view and your fonctionalities exist. And i dont think it will be a good choice : create is easier to edit

I hope i helped

Neven left a reply on How To Integrate Alfresco In Laravel?

It is not enough to use composer like this ? composer require ajtarragona/alfresco-laravel

To make an API Rest with Laravel you can do this without Alfresco, laravel/passport maybe

What do you need ?

Alfresco documentation : http://docs.alfresco.com/4.0/concepts/integration-options.html

Neven left a reply on Sending Mail Blade Template With Variables Through Mailgun Php SDK.

Hi, A Maill::class exist by default in Laravel. You dont need Mailgun. To transmit a variable you need to do something like this :

Mail::send('emails.discount-mail', compact('mailData'), function ($message) use ($mailData) {
          $message
                ->from('[email protected]_DOMAIN', 'CONTACT_TITLE')
                ->to($mailData['destination'])
                ->subject($mailData['subject']);
        });     

I hope I helped, cordially

18 Mar
6 months ago

Neven left a reply on Route Group Prefix No Working

Hi, if you try this command : php artisan route:list

Can i see the log ?

Neven left a reply on Laravel Vue Router Not Working

Hi, Im not the best for this but i think your 2nd router-link is false.

 <router-link :to="{ name: 'action_details' }">details</router-link>

Maybe that will help you more : https://laravel-news.com/using-vue-router-laravel