Boris56

Boris56

Nantes

Member Since 3 Years Ago

Experience Points 9,265
Experience
Level
Lessons Completed 78
Lessons
Completed
Best Reply Awards 1
Best Answer
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.

06 Jul
5 months ago

Boris56 left a reply on Best Way: Ajax And Route

Thank you!

Boris56 left a reply on Best Way: Ajax And Route

@Snapey Yes, is for use on admin panel, so use regular routes on web.php is better ?

Boris56 started a new conversation Best Way: Ajax And Route

Hi,

I would like to know what is the best way to use Laravel roads with ajax calls.

Use the classic "web.php" routes use by php app or create specific routes in "api.php"?

I am asking for safety and good practice.

Thank you.

18 Jun
1 year ago

Boris56 left a reply on Check If This Is A New Form Entry.

A simple isset($post) is good.

Boris56 left a reply on Check If This Is A New Form Entry.

I use a unique form too but ...->exists() don't work.

I need to call $this or $post ?

Boris56 started a new conversation Check If This Is A New Entry.

Hi,

When creating a new entry, I want to display a version of the code in the blade template.

How to determine, with blade, if the form is for a new entry and not to edit an existing entry?

Thank you.

15 Jan
1 year ago

Boris56 left a reply on Vagrant Up SSH Issues

This may come from Virtualbox which is not up to date.

Update Virtualbox and try.

06 Oct
2 years ago

Boris56 left a reply on How To Show This Message?

Hi, You can use the flash message.

if ($oldPassword==$user->password) {
            $user->update($request->input('password'));
        session()->flash('flash_message', 'Success message...');
                return redirect()->back();
        }else{
        session()->flash('flash_message', 'Fail message...');
                return redirect()->back();
        }

On view :

 @if(Session::has('flash_message'))
                    <div class="alert alert-success">
                        {{ session('flash_message') }}
                    </div>
                @endif 
19 Sep
2 years ago

Boris56 left a reply on Migration Error 1005

Hi,

Name: catagory or category ?

Boris56 left a reply on Passport Error 500

Hi found,

On my gulpfile.js, I replace a var by const and Passport work again.

I don't know why, but it's work.

18 Sep
2 years ago

Boris56 left a reply on LocalHost:8000 Doesn't Work

What PHP command you writing to start the server?

16 Sep
2 years ago

Boris56 left a reply on Passport Error 500

Hi,

The logs do not date me errors, in any case I do not see.

Another thing, I set up the middleware, for the access to my own API and still have an error "Unauthenticated".

Any idea ? Thank you.

09 Sep
2 years ago

Boris56 started a new conversation Passport Error 500

Hi,

I have install Laravel Passport, but whan I want create à new token, client or personnal, I have a error 500 and error on token `/home/vagrant/seethat-website/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php#6 The token meta exist. Any idea? Thank you.

22 Aug
2 years ago

Boris56 left a reply on Show Image On Storage

Finaly I found simple solution, a route with a controller :

The route :

Route::group([
    'prefix' => 'medias'
], function () {
    Route::get('/{name}', '[email protected]');
});

The controller:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use Response;
use Storage;

class MediaController extends Controller
{
    /**
     * @param $name
     * @return \Illuminate\Http\Response
     */
    public function index($name)
    {
        if (!Storage::exists($name)) {
            return Response::make('File no found.', 404);
        }

        $file = Storage::get($name);
        $type = Storage::mimeType($name);
        $response = Response::make($file, 200)->header("Content-Type", $type);

        return $response;
    }
}

Boris56 started a new conversation Image Upload As Corrupted

Hi,

I upload a file on storage, this doing well but the file uploaded is corrupted.

Impossible to open the file.

Any idea? Thank you.

$media = new Media();
$file = $request->file('media');

$media->filename = $file->getClientOriginalName();
$media->extension = $file->getClientOriginalExtension();
$media->mime_type = $file->getClientMimeType();
$media->size = $file->getSize();

$media->save();
Storage::put($media->filename . '.' . $media->extension, $file);
14 Aug
2 years ago

Boris56 started a new conversation The Best Way ?

Hello,

I wondered what was the best way, at least the most optimal to write code with a simple example.

mb_strtolower vs Str::lower

The Str::lower call mb_strtolower so what the best method in Laravel, stay on the native PHP, or import the Str class who call native PHP function any way?

Thank you.

08 Jun
2 years ago

Boris56 started a new conversation Mutators: Access All Attributes

Can we have access other attributes in a mutators, setter or getter, in addition to the predesignated?

Thank you.

07 Jun
2 years ago

Boris56 started a new conversation PhpStorm Autocomplete Not Working With Facade

Hi,

I use IDE Helper from barryvdh and on my controller I use the File and Response facade and I call them on top of file and the problem is the firefox autocoplete don't work, he don't find any method on each facade...

Any idea?

06 May
2 years ago

Boris56 left a reply on Show Image On Storage

Why we have a public folder on storage if we can't access easy to files ?

Boris56 started a new conversation Show Image On Storage

Hello,

After research, I can not find good way to show the images that are upload in the "storage" folder.

How to get the right path, for example: "ndd.com/image-patch-sur-storage" files to the "storage" folder?

Thank you.

07 Mar
2 years ago

Boris56 left a reply on Best Way For Check If Slug Exist On Database

This is perfect.

But in which conditions can we use the validation method?

Boris56 left a reply on Best Way For Check If Slug Exist On Database

I use this 'slug' => 'unique:articles, slug', but he did not return an error before recording in the database.

06 Mar
2 years ago

Boris56 started a new conversation Best Way For Check If Slug Exist On Database

I would like to know if you have a good solution to check in the database if the slug of an article, for example, already exists when creating a new item or update.

Thank you.

05 Mar
2 years ago

Boris56 left a reply on Acces To Model.php Functions ?

I want to create a generic function for update published_at and use it anywhere. Also i have some conditions to apply on it.

That's why I want to create a function. Is not that easy to do that:

$thing->published_at = Carbon\Carbon::now();

Boris56 left a reply on Acces To Model.php Functions ?

On Model.php file.

vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php - Line 1794.

Boris56 left a reply on Acces To Model.php Functions ?

I try to create a function for update 'published_at' timestamp on some condition. I am inspired by functions for creating 'created_at' and 'updated_at'.

By for not nothings work.

I have just this code on my model for now:

    public static function updatePublishedAt()
    {
        $time = Movie::freshTimestamp();
        dd($time);
    }

Boris56 started a new conversation Acces To Model.php Functions ?

I can not have an acces on Model functions or I try the wrong way ?

Non-static method Illuminate\Database\Eloquent\Model::freshTimestamp() should not be called statically

04 Mar
2 years ago

Boris56 left a reply on CSS Checkbox Help

The circle is a styled :before pseudo-element on label element.

Boris56 left a reply on CSS Checkbox Help

Look this CodePen : http://codepen.io/CreativeJuiz/pen/BiHzp

Is a full CSS checkbox.

Boris56 left a reply on Add New Entrie On Request All

Perfect thank!

Boris56 started a new conversation Add New Entrie On Request All

Can we add a line in the table of the $request-> all(); to add an entry that does not exist in the form? For update of the slug when we update the title, for example.

29 Dec
2 years ago

Boris56 left a reply on Change PublicPath()

So, the question is why the hosting move and chang folder name.

Like said @premsaurav we can't simply change the folders structures or override Illuminate, but with that, the principle of dependencies is useless.

Boris56 left a reply on [5.2] Login/Logout Not Possible

Try the new Route call for default Auth routes :

Route::auth();

instead of :

Route::get('login', 'Auth\AuthController@getLogin');
Route::get('auth/login', 'Auth\AuthController@getLogin');
    Route::get('auth/logout', 'Auth\AuthController@getLogout');
    Route::get('auth/register', 'Auth\AuthController@getRegister');
 Route::post('auth/login', 'Auth\AuthController@postLogin');

Boris56 left a reply on Change PublicPath()

Hi,

Why change this name?

16 Nov
3 years ago

Boris56 left a reply on Homestead And Admin IP Filter

In fact, just find your own local IP address on Homestead with $request->ip().

My IP 10.0.2.2 no longer work. I don't know why.

04 Nov
3 years ago

Boris56 left a reply on Homestead And Admin IP Filter

Finally I found, use local IP 10.0.2.2.

Boris56 started a new conversation Homestead And Admin IP Filter

Hi,

I set up an IP filter on the party administration, but the concern is that Homestead permission is denied and this despite the different IP I set.

The localhost and the VM's IP does't work.

An idea ?

Thank you.

30 Aug
3 years ago

Boris56 left a reply on Class 'App\Http\Controllers\Controller' Not Found

Try the namespace namespace App\Http\Controllers\Auth; in AuthController.

Boris56 left a reply on Call To Undefined Method Illuminate\Database\Eloquent\Collection::movie()

@xdimension : yes the ID is good and file populated. @frezno : yes the models are imported

The test with the tinker work, but not in the page...

29 Aug
3 years ago

Boris56 left a reply on Resources\assets\sass\app.scss <-- Not Found

Either the file does not exist, or the Elixir package has not been installed during the npm install.

Boris56 started a new conversation Call To Undefined Method Illuminate\Database\Eloquent\Collection::movie()

Hello,

I have a One to Many reation between movies and media.

I associate the media in movie controller so I search the image and associate it the ID of the movie.

This work in Tinker but not in live... I can not understand where this error comes.

In FileEntry :

    {
        return $this->belongsTo('App\Movie');
    }```

In Movie:

```public function files()
    {
        return $this->hasMany('App\FileEntry');
    }```

```        $file = FileEntry::find($request->input('files'));

        $file->movie()->associate($id);
        $file->save();```