RomainLanz

Experience

66,745

49 Best Reply Awards

  • Member Since 3 Years Ago
  • 440 Lessons Completed
  • 0 Favorites

27th January, 2017

RomainLanz left a reply on Laravel Mix ERROR ( LARAVEL 5.4.5) • 9 months ago

Hey !

Are you running on Windows ?

If yes there's some problem with fs-event. You must use the flag --no-optional.

16th November, 2016

RomainLanz left a reply on Laracasts Refresh • 1 year ago

I'm loving the new design!

One notice, the login-modal is in the HTML even if you are already logged in. This made LastPass buggy because he tries to log you in each time (if you have the auto-loggin enabled).

29th September, 2016

RomainLanz left a reply on AdonisJs 3.0 Is Out - Laravel For Node.js • 1 year ago

But why would you need to create your own wrapper if there's already an official PHP package to call gRPC?

--> https://github.com/grpc/grpc/tree/master/src/php

RomainLanz left a reply on AdonisJs 3.0 Is Out - Laravel For Node.js • 1 year ago

@leonardharley gRPC has a PHP version if you look at the repository: https://github.com/grpc/grpc

21st September, 2016

RomainLanz left a reply on .gitignore What Should Be Ignored? • 1 year ago

@kreierson Your composer.lock file already manage to keep the same version of packages you use in production.

RomainLanz left a reply on AdonisJs 3.0 Is Out - Laravel For Node.js • 1 year ago

Hey @leonardharley !

Which type of information do you need? I'll be happy to answer to some of your questions.

We're thinking along the lines of Vue on the front-end with Adonis on the backend. Does this make sense? Why this would make sense? Front-end and back-end are different things, you can use whatever frontend framework with whatever backend technologies/frameworks.

12th September, 2016

RomainLanz started a new conversation Oivva/boxy: The Most Hackable Theme For Sublime Text 3 • 1 year ago

Hey everyone !

I just found an awesome theme for Sublime Text 3 that I think you should give a look.

--> https://github.com/oivva/st-boxy

9th September, 2016

RomainLanz left a reply on How To Ignore Local Composer.lock On FORGE Server And Pull Newest From GitHub? • 1 year ago

Hey @mesqueeb !

You should connect to your server with ssh and reset the stage.

git status # You should see your composer.lock file
git checkout -- composer.lock

Then you can relaunch your deployment. Ensure that you aren't running composer update in your deployment script.

7th September, 2016

RomainLanz left a reply on Caching Eloquent Models Since Laravel 5 • 1 year ago

No.

Look at the Cache Documentation chapter Retrieve & Store.

RomainLanz left a reply on Where('field', Null) Is Not Working • 1 year ago

Hey @rene !

You should check if the value of $request->get('foobar') is null or not when writing your query.

$query = Foobar::where('user_id', 1)

if (!is_null($request->get('foobar'))) {
  $query->where('second_id', $request->get('foobar'));
}

$query->first();

RomainLanz left a reply on Caching Eloquent Models Since Laravel 5 • 1 year ago

Hey @BartHuis !

Maybe you should give a try to the package made by @Omranic : The art of using Repositories in Laravel 5.3

RomainLanz left a reply on Custom Facace Throws "Class 'App\Providers\App' Not Found" • 1 year ago

Hey @Rocky !

The issue is in App\Providers\PlayOnServiceProvider.php.

You are using App without importing it!

<?php

namespace App\Providers;

use App;
use Illuminate\Support\ServiceProvider;

class PlayOnServiceProvider extends ServiceProvider
{
    // ...
}

RomainLanz left a reply on What Is The Best Way To Implement Social Auth And Payments? • 1 year ago

Hey @Alzaabi98 !

For Social Login you should take a look to Socialite.

For payments there's Cashier (for Stripe) or Cashier Braintree for Braintree.

RomainLanz left a reply on Get Child Id To Array • 1 year ago

Hey @wipflash !

Seems to be a great idea to use mapand flatten! (Thanks to @adamwathan)

// Assuming that $childs is your array
$childIds = collect($childs)->map(function ($item) {
    return collect($item)->flatten();
});

Code Example: http://pastebin.com/kBaWqrUM

6th September, 2016

RomainLanz left a reply on Storing Users • 1 year ago

@nate.a.johnson According to the category of the forum he asks for a code review.

I cannot do it right know but I'll be happy to do it tomorrow if no-one else has done it before ! :)

RomainLanz left a reply on Two Models With Similar Name. • 1 year ago

Hey @Archduke !

So you have a table named CreateOffers and a model name CreateOffer?

The convention of Laravel is to snake case your model and pluralize it to get the table name, if you have something different you can override the default table name by setting the table attribute on your model.

<?php

class CreateOffer extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'CreateOffers';
}

Related documentation

RomainLanz left a reply on Artisan Output Colours (low Contrast = Unreadable) • 1 year ago

Hey @derekmcwhinnie !

This is not the fault of Laravel.

You may change the colorsheme of your terminal (or the contrast in the configuration) to get something that you like.

RomainLanz left a reply on View Depending On Middleware • 1 year ago

Hey @JhumanJ and welcome to Laracasts!

Your code looks perfectly fine. Did you get any error or it is just always redirecting to one view?

RomainLanz left a reply on Create Route To Controller That Is In It's Own Folder • 1 year ago

@mstnorris You can only use the / and it will work perfectly.

php artisan make:controller Admin/PostController

RomainLanz left a reply on Create Route To Controller That Is In It's Own Folder • 1 year ago

You should namespace it!

Route::get('/admin/posts', 'Admin/[email protected]');

and inside your PostController

<?php

namespace App/Http/Controllers/Admin;

// ...

RomainLanz left a reply on Upgrade To Laravel 5.3 Killed Localhost • 1 year ago

I tried changing the Laravel index.php file to simply echo a "p" element to test, but still the same problem.

It seems to be an issue with Apache. You should check the log of it.

RomainLanz left a reply on Database Engines With Laravel • 1 year ago

You can use the Eloquent ORM to have fluid "sql queries" with both of them.

RomainLanz left a reply on Database Engines With Laravel • 1 year ago

but is it the best for my project ?

As we said, it all depends on your application specification.

  • MongoDB is a document-oriented (NoSQL) database engine.
  • MySQL is a relational database engine.
  • PostegreSQL is a object-relational database engine.

RomainLanz left a reply on Database Engines With Laravel • 1 year ago

Its all depending on your application. Personally I recommend you to use PostgreSQL.

Here's a good podcast about it Full Stack Radio 40: Edd Mann - You Should Switch to Postgres

RomainLanz left a reply on Method Chaining On Model • 1 year ago

Hey @eddy1992 !

The result you get is an instance of your Eloquent model. You need to add a public method named checkIfPhoneExists() into your Customer model.

RomainLanz left a reply on Relation After A Value • 1 year ago

Hey @crazydan !

You should definitively go for Query Scope.

RomainLanz left a reply on Simple Eloquent Relationship • 1 year ago

That's because you are showing the Country object of the user.

If you want to display the name of the country you should do get the attribute of Country object.

{{ $user->country->country }} 

RomainLanz left a reply on Simple Eloquent Relationship • 1 year ago

Hey @jim1506 !

Correct me if I didn't correctly understand your question but you want to get all the users with country information on it?

If yes, it's the perfect job to use Eager Loading.

$users = User::with('country')->get();

Pro Tip: Your user relation on Country model should be called users because it's a HasMany.

RomainLanz left a reply on [Laravel 5.3.6] How To Modify "make:auth" Route To "/home" Behavior? • 1 year ago

Hey @Laraveldeep !

The redirection is in the Middleware RedirectIfAuthenticated at the line 21.

RomainLanz left a reply on What Development Languages Laracasts.com Is Developed • 1 year ago

Hey @shafiqkr !

Laracasts is developed with Laravel and VueJs. The UI has been homemade by Jeffrey Way with Stylus and LostGrid (He has a series about it https://laracasts.com/series/modern-css-workflow).

27th June, 2016

RomainLanz started a new conversation AdonisJs 3.0 Is Out - Laravel For Node.js • 1 year ago

Hey everyone!

I want to share with you a great new. AdonisJs 3.0 is out !

AdonisJs is a true MVC Framework for Node.js. It encapsulate all the boring parts of Web programming and offers you a nice & clean API to work with.

https://adonisjs.svbtle.com/adonisjs-30-release

Website: http://adonisjs.com/

4th May, 2016

RomainLanz left a reply on Laravel Echo • 1 year ago

Oh, it wasn't a teaser so.... :(

Thanks!

RomainLanz started a new conversation Laravel Echo • 1 year ago

Taylor tease us about a new Laravel Thing yesterday !

https://twitter.com/taylorotwell/status/727357237476257793

What do you it would be?

4th March, 2016

RomainLanz left a reply on Spark Will Not Be Free • 1 year ago

Here's the Reddit thread: https://www.reddit.com/r/laravel/comments/48tzkg/laravel_spark_will_not_be_free_unjustifiable_to/

@bashy Some people have fork the alpha. You can find the link in the reddit thread.

11th January, 2016

RomainLanz started a new conversation How To Get Auth Model With L5.2 • 1 year ago

Hey,

I have a little package to implements easily Polymorphic Nested Comments in Laravel.

In the model Comment I have a relation who belongs to the User model.

/**
 * Get the user that creates the comment.
 *
 * @return Illuminate\Database\Eloquent\Relations\BelongsTo
 */
public function user()
{
    return $this->belongsTo(config()->get('auth.model'));
}

In Laravel 5.1, the model can easily be retrieved via the configuration file. But with 5.2, this section has change and I have no idea how to properly get it.

Does anyone have an idea?

PR are welcome. https://github.com/Slynova-Org/laravel-commentable/issues/3

7th December, 2015

RomainLanz left a reply on Where Should I Put This? • 1 year ago

which gets a user's latest review for a venue.

It speak by itself. You should place this method in the UserRepository.
BTW, it doesn't really matter. Do what you think is the most logic to you.

RomainLanz left a reply on Color Theme Jeffrey Uses In Vue Training Series • 1 year ago

He uses Sublime Text with the Material Theme and the Facebook Colorscheme.

He mades a series about his setup in Sublime.

2nd December, 2015

RomainLanz left a reply on Route Issue • 1 year ago

What's the content of your stores() method?

RomainLanz left a reply on Laravel For The NodeJS World • 1 year ago

Have you done any work with it yet I discovered it today, so no.

I will try it before the end of the week and give some feedbacks here. There's some ScreenCasts available.

Laravel equivalent syntax that AdonisJS offers in comparison to ExpressJS Just for the ES2015 feature/syntax it's worth to switch in my opinion.

RomainLanz started a new conversation Laravel For The NodeJS World • 1 year ago

Hey everyone!

I have just discovered the framework AdonisJS.

What is it awesome with it ? It's a Laravel port to the NodeJS world!

Hope that you will enjoy to test it and develop with it.

30th November, 2015

RomainLanz left a reply on How To Encrypt My Code In Php In General And In Laravel In Specific • 1 year ago

ASP.NET does not encrypt the code. It's just a compiled language.

PHP is a dynamic language, so you can't compiled it to a binary.

28th November, 2015

RomainLanz left a reply on How To Stress Test My Laravel App? • 1 year ago

There is a thread Load Testing Tool.

Does it help?

25th November, 2015

RomainLanz left a reply on Building A Robust Decorator • 1 year ago

I think you are speaking about Single Table Inheritance ?

RomainLanz left a reply on Update Get Id • 1 year ago

If you want to get the ID of the eddited row you can do it like this.

$post = Post::update($request->all());

Or, if you want the latest edited record you can do:

$post = Post::orderBy('updated_at')->first();

22nd November, 2015

RomainLanz left a reply on Permission Denied • 1 year ago

The error is pretty clear...

You don't have the permission to delete the file. Also, note that there's nothing returned by $book->book_path.

20th November, 2015

RomainLanz left a reply on Some Of My Laravel Authorization Abilities Work And Some Don't. • 2 years ago

Also

public function isAdmin()
{
    return $this->hasRole('admin');
}

RomainLanz left a reply on Some Of My Laravel Authorization Abilities Work And Some Don't. • 2 years ago

You can simplify your method by doing

public function is_Admin(User $user)
{
    return $user->isAdmin();
}

Can we see the isAdmin() method?

RomainLanz left a reply on Front End Frameworks • 2 years ago

@bestmomo

I've seen Toasts but there are called with Javascript and it's not simple to add an alert on load.

Yes it is.

I think that you haven't seen this Elegant Flash Messaging in Build "ProjectFlyer" With Me episode?

He use SweetAlert that is called with JavaScript.

What you should do to call an alert with JavaScript is simple.

{-- alert.blade.php --}
@if (session()->has('flash_message'))
    <script>
        // Call your alert here
    </script>
@endif
Edit Your Profile
Update

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