Sergiu17

Sergiu17

Member Since 1 Year Ago

Chisinau

Experience Points 267,800
Experience Level 50

0 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 1410
Lessons
Completed
Best Reply Awards 191
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.

22 May
1 day ago

Sergiu17 left a reply on How To Override Application Config Values

Hi, check this out https://github.com/ImLiam/laravel-env-set-command

Not necessarily to install this package in your project, just take a look how you could do this.

Basically, functions like fopen, fwrite will help you

21 May
2 days ago

Sergiu17 left a reply on Want To Disable This Method In Form Request Validation File

@TOWHID - I guess that here is the problem $data = $request->validate();

First of all, you already validate data in your Form Request. try to remove it

or CTRL + Click on validate(), you need to pass an argument to it

Sergiu17 left a reply on Want To Disable This Method In Form Request Validation File

Show your method from controller

Sergiu17 left a reply on What Journey Should I Take?

Hi, https://laracasts.com/skills/laravel I think that on this page, courses are in proper order, from basic to advanced.

Sergiu17 left a reply on Undefined Offset: 1

foreach ($category as $key => $value) {
        $array[$value->id].' '.$value->name;
    }

this is dead code.. you do nothing with it you may need to change it

foreach ($category as $key => $value) {
        $array[$value->id] = $value->name;
    }

Sergiu17 left a reply on Method Not Allowed Exception

Route::get('/login', '[email protected]')->name('login.process');

Sending Post Request To Get Request

Sergiu17 left a reply on Fata Error, Call To Undefined Function Test_input()

Error message is quite clear, you don't have defined function called test_input

Sergiu17 left a reply on Undefined Index: Id,image,name,price

@PAULCATALIN97 - It has the data, but it doesn't have the keys!

Sergiu17 left a reply on Undefined Index: Id,image,name,price

foreach($result as $row)
{
    var_dump($row); die();
}

Is your $row and array? does it include id, image, name and price?

Sergiu17 left a reply on Prefix Route Problem

@KUNDEFINE - Looks like this is the problem, Laravel first tries to open that folder, and there's no index.php or index.html.

One way - rename folder

Second - edit .htaccess

Sergiu17 left a reply on Prefix Route Problem

do you have dashboard directory in your public folder?

20 May
3 days ago

Sergiu17 left a reply on Middleware Supports

@ARJUNKAIMATTATHIL - This is other problem, error message is quite clear

// some examples
'string'->property
[]->property

in examples above you get 'Try to get property of non_object'.

19 May
4 days ago

Sergiu17 left a reply on Where Correct Word

@MO7SIN - Upper case and lower case

Sergiu17 left a reply on Organize By Creation

@ZFDEVELOPER - you could add simple orderBy

User::orderBy('created_at', 'desc')->get();

Sergiu17 left a reply on Organize By Creation

@ZFDEVELOPER - How do you grab users from database?

Sergiu17 left a reply on Organize By Creation

What goes to the last in the listing?

Sergiu17 left a reply on How To Add Variable Into Mailable's Build() Function?

You could do this in constructor

class TranslationTask extends Mailable
{
    private $name;

    public function __construct(Task $task)
    {
        $this->name = 'What ever you want';
    }

    public function build()
    {
        return $this->markdown('emails.translation')
                                     ->subject($this->name);
    }

or I'm missing something?

17 May
6 days ago

Sergiu17 left a reply on How To Create Two Columns With @foreach?

@IRANKHOSRAVI - Read documentation, learn the basics....

dd($services);
dd($services->first()); // this is an array...

@foreach($services as $row)
    dd($row)
@endforeach

This is called debug................

16 May
1 week ago

Sergiu17 left a reply on Save File With Original Extension

$ext = $image->getClientOriginalExtension(); // method returns extension.

Instead of .png, use . $ext

14 May
1 week ago

Sergiu17 left a reply on PHPUnit MySQL In Memory Test With Point And Polygon Column

@PONCETHELION - and the packages supports only Laravel 5.5 and lower versions

Sergiu17 left a reply on PHPUnit MySQL In Memory Test With Point And Polygon Column

https://github.com/grimzy/laravel-mysql-spatial

For Laravel versions prior to 5.5, you can use the Blueprint provided by this package (Grimzy\LaravelMysqlSpatial\Schema\Blueprint):

For Laravel < 5.5

13 May
1 week ago

Sergiu17 left a reply on Where I Can Save Array For Blade?

@VIG - if it's really alphabet, then you don't need to store it

@foreach(range('a', 'z') as $let)
    {{ $let }}
@endforeach

Sergiu17 left a reply on How To Pass Id Into Middleware In Laravel

@VAN1310 - read log, storage/logs/curent-date.log

Sergiu17 left a reply on How To Pass Id Into Middleware In Laravel

@VAN1310 - could you add one more if condition?

Sergiu17 left a reply on How To Pass Id Into Middleware In Laravel

@VAN1310 - ok,

if ( user is logged in && signed in user has verified account ) {
    redirect to login page
}

Why redirect authenticated user to login page?

Sergiu17 left a reply on How To Pass Id Into Middleware In Laravel

@VAN1310 - read this

if(\Auth::check() && \Auth::signup()->verify())
{            
                return \Redirect::route('login'); 
}

Sergiu17 left a reply on How To Pass Id Into Middleware In Laravel

@VAN1310 - OK, delete 3rd parameter from your handle function, and it will work,

return \Redirect::route('otp.view', auth()->id); // auth()->id, instead if $id

Sergiu17 left a reply on How To Pass Id Into Middleware In Laravel

@VAN1310 - There already are auth and verify middlewares :)

10 May
1 week ago

Sergiu17 left a reply on Not Working Show Function In Laravel 5.7

@MSOFT - This is other route, the problem is the link to show method

// this is in the for loop somthere
<a href="{{ url('studentcourcedata', ['id' => $id]) }}">Student Course</a>
  1. Update de route as I said
Route::get('studentcourcedata/{id}','[email protected]')->name('studentcourcedata');
  1. Search in your project for {{ url('studentcourcedata') }}

  2. Update it, by passing the ID, {{ url('studentcourcedata', ['id' => $id]) }}

Sergiu17 left a reply on Not Working Show Function In Laravel 5.7

you need to pass $id to url

  <form action="{{url('studentcourceform', ['id' => $id])}}" method="post">

something like this

Sergiu17 left a reply on Not Working Show Function In Laravel 5.7

// error
Route::get('studentcourcedata','[email protected]')->name('studentcourcedata');
// fix
Route::get('studentcourcedata/{id}','[email protected]')->name('studentcourcedata');

because
class StudentcourceController extends Controller
{
    public function show($id // <---------- this function waits an parameter 
}

Sergiu17 left a reply on Web Hosting

Take a look at Vimeo

09 May
2 weeks ago

Sergiu17 left a reply on Search Function MYSQL

@WUSCHELINO22 - What is your model name? Categorie or Category?

Sergiu17 left a reply on Search Function MYSQL

@WUSCHELINO22 - You need to import the class, I just told you to read the documentation :D

<?php

namespace App\Providers;

use Illuminate\Support\Facades\View; // THIS IS WHAT YOU NEED
use App\Category;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        View::share('categories', Category::all());
    }
}

Sergiu17 left a reply on Search Function MYSQL

@WUSCHELINO22 - In Accordion section

<!-- Accordion  -->
<div class="accordion" id="accordionExample">
@foreach ($categories as $categorie)

<div class="card">
    <div class="card-header" id="headingSix">
      <h2 class="mb-0">
        <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapse{{$categorie->id}}" aria-expanded="false" aria-controls="collapse{{$categorie->id}}" style="color: black">
        {{ $categorie->name}}
        </button>
      </h2>
    </div>
    <div id="collapse{{$categorie->id}}" class="collapse" aria-labelledby="heading{{$categorie->id}}" data-parent="#accordionExample">
      <div class="card-body">

    <!-- Einf├╝gen der Daten in die Tabelle nach Kategorie ID -->
      @foreach($shares->where('categorie_id', $categorie->id) as $share)
      <a href='{{ $share->urls }}' style="color: black">{{ $share->name }}</a><br>
      @endforeach
      </div> 
    </div>
</div>       
        @endforeach
</div>

Here is the problem, you try to access $categories variable, but it's not available, because in the controller you return only shares

return view('index', compact('shares'));

If $categories is used in index.php (this means that is used in every view template)

So, you need somehow to share $categories all the time to index.php

Open app/Providers/AppServiceProvider.php in the boot method

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        View::share('categories', Category::all());
    }

Something like this.

Here is the documentation -

https://laravel.com/docs/5.8/views#passing-data-to-views

https://laravel.com/docs/5.8/views#view-composers

Read it!

Sergiu17 left a reply on Search Function MYSQL

Error is quite clear.

In resources\views\index.blade.php you use -$categories variable..and because, you don't pass this variable to the view - it is undefined.

You may consider view composers https://laravel.com/docs/5.8/views#view-composers

Sergiu17 left a reply on Display 4 Or More Different Tables In One View Page

One controller is fine.

public function report()
{
    $set1 = Model::all();
    $set2 = Model2::all();
    // ....

    return view('report', compact('set1', 'set2', '...');
}
08 May
2 weeks ago

Sergiu17 left a reply on Sending Mail With Attachments In Laravel 5.7

@LARAVELYV - this may help you - https://medium.com/@hfally/how-to-make-multiple-attachments-to-mail-in-laravel-5-6-34b227ba3be1

You can't use implode() to send all files together, you need to loop over each file.

reformat your code.. with ``` (backticks) before and after code

``` // CODE HERE ```

Sergiu17 left a reply on "Call To A Member Function HasFile() On Null"

Input::hasFile('myfile')

try this

07 May
2 weeks ago

Sergiu17 left a reply on Display Data Which Are Inserted A Today /daily Basis

Expenses::where('created_at', Carbon::today())->get();

Like so?

04 May
2 weeks ago

Sergiu17 left a reply on Using Admin Middleware In Some Only Resource Routing

Easiest way is to add middleware in constructor of the class

class RaccolteController extends Controller {
    
    public function __construct() {
        $this->middleware('admin')->only(['store', 'create']);
    }
}
03 May
2 weeks ago

Sergiu17 left a reply on Referencing All Models At Once In A Controller?

You could use

use App\Http\Models{
    CarModel,
    UserModel,
    PostModel,
    . . .
}

Is this practical ?

Never did this before, and never heard about. Importing everything - means your controller is doing too much

Are there any performance issues ?

use - is like Symbolic Link, like References works. Imagine creating a shortcut of your application to your desktop. So, not big deal importing them

02 May
3 weeks ago

Sergiu17 left a reply on Call To Undefined Relationship [videolikes] On Model [App\Videopost].

likesVideo
videolikes

two different things