Boris56

Experience

9,265

1 Best Reply Awards

  • Member Since 2 Years Ago
  • 78 Lessons Completed
  • 0 Favorites

6th July, 2018

Boris56 left a reply on Best Way: Ajax And Route • 1 week ago

Thank you!

Boris56 left a reply on Best Way: Ajax And Route • 1 week ago

@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 • 1 week ago

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.

18th June, 2017

Boris56 left a reply on Check If This Is A New Form Entry. • 1 year ago

A simple isset($post) is good.

Boris56 left a reply on Check If This Is A New Form Entry. • 1 year ago

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. • 1 year ago

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.

15th January, 2017

Boris56 left a reply on Vagrant Up SSH Issues • 1 year ago

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

Update Virtualbox and try.

6th October, 2016

Boris56 left a reply on How To Show This Message? • 1 year ago

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 

19th September, 2016

Boris56 left a reply on Migration Error 1005 • 1 year ago

Hi,

Name: catagory or category ?

Boris56 left a reply on Passport Error 500 • 1 year ago

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.

18th September, 2016

Boris56 left a reply on LocalHost:8000 Doesn't Work • 1 year ago

What PHP command you writing to start the server?

16th September, 2016

Boris56 left a reply on Passport Error 500 • 1 year ago

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.

9th September, 2016

Boris56 started a new conversation Passport Error 500 • 1 year ago

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.

22nd August, 2016

Boris56 left a reply on Show Image On Storage • 1 year ago

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 • 1 year ago

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);

14th August, 2016

Boris56 started a new conversation The Best Way ? • 1 year ago

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.

8th June, 2016

Boris56 started a new conversation Mutators: Access All Attributes • 2 years ago

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

Thank you.

7th June, 2016

Boris56 started a new conversation PhpStorm Autocomplete Not Working With Facade • 2 years ago

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?

6th May, 2016

Boris56 left a reply on Show Image On Storage • 2 years ago

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 • 2 years ago

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.

7th March, 2016

Boris56 left a reply on Best Way For Check If Slug Exist On Database • 2 years ago

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 • 2 years ago

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

6th March, 2016

Boris56 started a new conversation Best Way For Check If Slug Exist On Database • 2 years ago

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.

5th March, 2016

Boris56 left a reply on Acces To Model.php Functions ? • 2 years ago

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 ? • 2 years ago

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 ? • 2 years ago

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 ? • 2 years ago

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

4th March, 2016

Boris56 left a reply on CSS Checkbox Help • 2 years ago

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

Boris56 left a reply on CSS Checkbox Help • 2 years ago

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 • 2 years ago

Perfect thank!

Boris56 started a new conversation Add New Entrie On Request All • 2 years ago

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.

29th December, 2015

Boris56 left a reply on Change PublicPath() • 2 years ago

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 • 2 years ago

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() • 2 years ago

Hi,

Why change this name?

16th November, 2015

Boris56 left a reply on Homestead And Admin IP Filter • 2 years ago

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.

4th November, 2015

Boris56 left a reply on Homestead And Admin IP Filter • 2 years ago

Finally I found, use local IP 10.0.2.2.

Boris56 started a new conversation Homestead And Admin IP Filter • 2 years ago

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.

30th August, 2015

Boris56 left a reply on Class 'App\Http\Controllers\Controller' Not Found • 2 years ago

I guess you have follow this doc for update L4 to L5 ? http://laravel.com/docs/5.1/upgrade#upgrade-5.0

Boris56 left a reply on Class 'App\Http\Controllers\Controller' Not Found • 2 years ago

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

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

@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...

29th August, 2015

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

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() • 2 years ago

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();```

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.