Naxon

Naxon

PHP Developer at InManage

Member Since 3 Years Ago

Tel Aviv

Experience Points
26,250
Total
Experience

3,750 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
240
Lessons
Completed
Best Reply Awards
2
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.

Level 6
26,250 XP
Sep
09
1 year ago
Activity icon

Started a new conversation Reload Index View

Hi!

I'm developing my first Nova field. It's an index field that contains a button which sends an Axios request, and when a response is being returned I need to reload the index view.

For now I got this:

this.$router.go(this.$router.currentRoute);

The problem is that it refreshes the entire page (a hard-refresh, like when you press Cmd+R). I just want to reload the current route (which is the index route of a resource).

I also tried this:

                    this.$router.push({
                        name: 'index',
                        params: {
                            resourceName: this.resourceName,
                        },
                    });

But since I pushed the same route, it does nothing.

Any ideas?

Thank's, Daniel.

Feb
03
1 year ago
Activity icon

Started a new conversation Laravel_session & Other Cookies Created Only On Main Route

Hi,

For some reason, the laravel_session and other cookies are created only when a visitor visits the main route. If he goes directly to an "inner" route (such as /cart or any other), the cookies aren't created at all.

Any reason for that / anything specific I have to do in order to force the cookies to be created anyway? Visitors aren't always visiting the main page of my website first.

Thank's, Daniel.

Aug
25
2 years ago
Activity icon

Started a new conversation Separating Frontend And Backend Controllers When Using Resource Controllers

Hi,

I recently adopted the resourceful controllers way and Adam Wathan's talk on Laracon US just made it more clear to me that I should stick with this approach.

But in Adam's talk he showed resourceful controllers for podcasts that are created, edited and deleted by users, means everything happens in the frontend.

But what about the case where I manage articles from my admin control panel (using the index, create, store, edit, update and destroy methods), and the user can only view the articles?

If I choose to separate frontend and backend controllers, I might have naming conflicts between my frontend routes and my backend routes. The second approach is to use one controller... But then there's no separation between the frontend and the backend code, and what about the index method? I might want to list all my articles in the frontend as well...

Any thoughts on that?

Aug
05
2 years ago
Activity icon

Replied to Is There Any Way To Know If I Came To A Model Via A Relationship?

Because the default price must change and I wanted to avoid having to update all my products when a default_price is updated

Activity icon

Replied to Email Confirmation Box Laravel Blade

in your register.blade.php, under the email field, you should add another field named email_confirmation:

<div class="form-group">
    <label for="email-confirm" class="col-md-4 control-label">Confirm Email</label>

    <div class="col-md-6">
        <input id="email-confirm" type="email" class="form-control" name="email_confirmation" required>
    </div>
</div>

Then in your RegisterController.php, inside the validator method, simply add the confirmed validation rule to your email field validation rules. It should look like this:

'email' => 'required|string|email|max:255|unique:users|confirmed',
Activity icon

Started a new conversation Is There Any Way To Know If I Came To A Model Via A Relationship?

Hi,

Let me explain the situation. I've got 2 models: Product and DeliveryMethod, with Many to Many relationship between them.

the DeliveryMethod has a default_price attribute, and the pivot table has a price attribute that is set to 0 by default.

I want to have a method on the DeliveryMethod model called getPrice(), that will return the price attribute from the pivot table if it's bigger than 0, or otherwise return the default_price attribute from the DeliveryMethod model.

I know I can have a separate method like getPriceForDeliveryMethod(). Is the option I described above even possible?

Thank's, Daniel.

May
20
2 years ago
Activity icon

Started a new conversation Running A Single Test With PHPStorm Opens It In The Browser

Hi,

I'm having a problem here with PHPUnit testing on PHPStorm. When clicking 'Run' the tests directory, it does what I expect and runs it as a test. But when I click 'Run' on a single test file, it opens it in the browser instead of running it as a test.

How can I configure PHPStorm to run those files as tests so I can run a single test and not the whole suite every time?

Thank's, Daniel.

Jan
28
2 years ago
Activity icon

Started a new conversation Can't Access Website With Www

Hi,

I have my website (let's say domain.com) installed on a Laravel forge server. On the same server, I also have a development environment set up on dev.domain.com.

When I try to access my main website with www (www.domain.com), for some reason I get the dev.domain.com site instead of the main site (domain.com).

The www.domain.com file on sites-available looks fine:

include forge-conf/www.domain.com/before/*;

server {
    listen 80;
    server_name www.domain.com;
    return 301 $scheme://domain.com$request_uri;
}

Also, when I try to install an ssl certificate using Let'sencrypt for www.domain.com I get the following error:

Whoops! There were some problems with your input.
First domain does not match root domain on site.

Any ideas how to fix it?

Dec
23
2 years ago
Activity icon

Started a new conversation Where Did The New Videos Section Disappear?

Hi, Can somebody tell if the "new videos" section that showed new videos since my last login was removed in the latest upgrade?

If so - @JeffreyWay please consider bringing it back....

Nov
19
2 years ago
Activity icon

Started a new conversation URL Encoding With Hebrew

I'm using slugs in my Laravel project for SEO reasons. The URL is built like this: https://website.com/page/{id}/{slug}. I want to allow my pages to be accessed with id only, and match the slug by myself. So if the user enters website.com/1, he will be redirected to website.com/1/slug.

So I wrote this method in the pages controller:

public function addSlug(Page $page)
{
    return redirect('/page/' . $page->id . '/' . $page->slug);
}

And in my routes file:

Route::get('/page/{page}', '[email protected]');

The only issue is that my slugs are Hebrew words, so instead of getting website.com/1/שער-7r example I get t `website.com/1/ש?

Is there a way to overcome this?

(Note: The database and file encoding is UTF-8)

(Note 2: I can access the page via website.com/1/hebrew-slug. I think the problem is with the redirect method).

Oct
14
3 years ago
Activity icon

Started a new conversation Logging Emails - Get The Email Subject And Sent To Address On Events

Hi,

I'm writing an email logger for my application.

I started with listening to the MessageSending event:

    protected $listen = [
        'Illuminate\Mail\Events\MessageSending' => [
            'App\Listeners\LogEmail',
        ],
    ];

Now, on my listener, I want to get the Mail subject and sent to address. How can I accomplish this? I tried using the $event->message variable, but all of it's properties are private so I can't reach any of them.

Sep
29
3 years ago
Activity icon

Started a new conversation Authentication Method For My Own Api

Hi,

I wanted to hear your opinion about something. I'm currently developing a mobile application that will make requests to an api based on laravel. The only one that's going to make requests to the server is me through one of my apps (iphone / android), so a user can't generate his own api keys to make requests.

I wanted the know what kind of authentication would you have used? A token-based authentication or authentication using Passport?

And let's think ahead a bit, in the future I might want to give the user the ability to generate his own api key to make requests through his application / website. Would the correct method for this be creating a separate api for this (because obviously i would want them to use slightly different methods than the ones I use) with Passport, or make a permission-based Passport authentication for my main api?

Thank's, Daniel.

Sep
25
3 years ago
Activity icon

Started a new conversation Can't See The Amount On Paypal

Hi,

I'm using netshell's Paypal package with Laravel 5.3. I have a controller method that redirects to a paypal payment page, there it is:

    public function paypal()
    {
        $payer = Paypal::Payer();
        $payer->setPaymentMethod('paypal');

        $amount = Paypal::Amount();
        $amount->setCurrency('ILS');
        $fee = MembershipFee::findOrFail(setting('current_season'));
        $amount->setTotal($fee->getPaymentAmount(Auth::user()));

        $transaction = Paypal::Transaction();
        $transaction->setAmount($amount);
        $transaction->setDescription('דמי חבר לעונת ' . $fee->season);

        $redirectUrls = Paypal::RedirectUrls();
        $redirectUrls->setReturnUrl(url('/members/membership-fee/thank-you'));
        $redirectUrls->setCancelUrl(url('/members/membership-fee/canceled'));

        $payment = Paypal::Payment();
        $payment->setIntent('sale');
        $payment->setPayer($payer);
        $payment->setRedirectUrls($redirectUrls);
        $payment->setTransactions(array($transaction));

        $response = $payment->create($this->_apiContext);
        $redirectUrl = $response->links[1]->href;

        return Redirect::to($redirectUrl);
    }

It does redirect me and I do see the description right, but I can't see the price. Here is a screenshot: http://screencast.com/t/vShz7kdzHkNp

Notice that I'm using sandbox, not live paypal payment. Is there any reason why I don't see the price?

And one more thing - after a successful payment a user is being redirected to the thank-you route. How can I confirm that he actually completed the transaction and didn't just get the page by the url?

Sep
17
3 years ago
Activity icon

Replied to Can't Login After Upload To Forge

@SaeedPrez That was it my friend. Thank you!

Activity icon

Replied to Can't Login After Upload To Forge

Well, I don't have the vendor directory on my server (it's on the default .gitignore)...

Activity icon

Replied to Can't Login After Upload To Forge

    public function username()
    {
        return 'username';
    }

before the change it was hard-coded with:

    public function username()
    {
        return 'email';
    }
Activity icon

Replied to Can't Login After Upload To Forge

@SaeedPrez I changed from email auth to username auth, but as I mentioned before, It works fine on my local machine.

LoginController.php

<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

class LoginController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Login Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles authenticating users for the application and
    | redirecting them to your home screen. The controller uses a trait
    | to conveniently provide this functionality to your appliations.
    |
    */

    use AuthenticatesUsers;

    /**
     * Where to redirect users after login / registration.
     *
     * @var string
     */
    protected $redirectTo = '/members';

    protected $username = 'username';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest', ['except' => 'logout']);
    }
}

AuthenticatesUsers.php

<?php

namespace Illuminate\Foundation\Auth;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Lang;

trait AuthenticatesUsers
{
    use RedirectsUsers, ThrottlesLogins;

    /**
     * Show the application's login form.
     *
     * @return \Illuminate\Http\Response
     */
    public function showLoginForm()
    {
        return view('auth.login');
    }

    /**
     * Handle a login request to the application.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function login(Request $request)
    {
        $this->validateLogin($request);

        // If the class is using the ThrottlesLogins trait, we can automatically throttle
        // the login attempts for this application. We'll key this by the username and
        // the IP address of the client making these requests into this application.
        if ($lockedOut = $this->hasTooManyLoginAttempts($request)) {
            $this->fireLockoutEvent($request);

            return $this->sendLockoutResponse($request);
        }

        $credentials = $this->credentials($request);

        if ($this->guard()->attempt($credentials, $request->has('remember'))) {
            return $this->sendLoginResponse($request);
        }

        // If the login attempt was unsuccessful we will increment the number of attempts
        // to login and redirect the user back to the login form. Of course, when this
        // user surpasses their maximum number of attempts they will get locked out.
        if (! $lockedOut) {
            $this->incrementLoginAttempts($request);
        }

        return $this->sendFailedLoginResponse($request);
    }

    /**
     * Validate the user login request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return void
     */
    protected function validateLogin(Request $request)
    {
        $this->validate($request, [
            $this->username() => 'required', 'password' => 'required',
        ]);
    }

    /**
     * Get the needed authorization credentials from the request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    protected function credentials(Request $request)
    {
        return $request->only($this->username(), 'password');
    }

    /**
     * Send the response after the user was authenticated.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    protected function sendLoginResponse(Request $request)
    {
        $request->session()->regenerate();

        $this->clearLoginAttempts($request);

        return $this->authenticated($request, $this->guard()->user())
                ?: redirect()->intended($this->redirectPath());
    }

    /**
     * The user has been authenticated.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  mixed  $user
     * @return mixed
     */
    protected function authenticated(Request $request, $user)
    {
        //
    }

    /**
     * Get the failed login response instance.
     *
     * @param \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    protected function sendFailedLoginResponse(Request $request)
    {
        return redirect()->back()
            ->withInput($request->only($this->username(), 'remember'))
            ->withErrors([
                $this->username() => Lang::get('auth.failed'),
            ]);
    }

    /**
     * Get the login username to be used by the controller.
     *
     * @return string
     */
    public function username()
    {
        return 'username';
    }

    /**
     * Log the user out of the application.
     *
     * @param  Request  $request
     * @return \Illuminate\Http\Response
     */
    public function logout(Request $request)
    {
        $this->guard()->logout();

        $request->session()->flush();

        $request->session()->regenerate();

        return redirect('/login');
    }

    /**
     * Get the guard to be used during authentication.
     *
     * @return \Illuminate\Contracts\Auth\StatefulGuard
     */
    protected function guard()
    {
        return Auth::guard();
    }
}
Activity icon

Replied to Can't Login After Upload To Forge

Works perfectly... I flashed some data to the session and it works... Only thing that doesn't work on forge is the login :(

Activity icon

Replied to Can't Login After Upload To Forge

Doesn't work... I changed the session driver to database. Works on local machine, not on forge.

Activity icon

Replied to Can't Login After Upload To Forge

Also, my bad - I don't get any error message when typing any kind of username or password (right or wrong). APP_ENV is set to local and APP_DEBUG is set to true. But when I query the database - I do get results.

Activity icon

Replied to Can't Login After Upload To Forge

@SaeedPrez That was the first thing I checked... it's the same one.

Activity icon

Started a new conversation Can't Login After Upload To Forge

Hi,

I started using Laravel Forge, got my site up and running real quick using quick deploy, also uploaded my database, and for some reason - I can't login to any user and no error is being displayed.

On my local machine the login works fine. The database connection is good.

Did this happen to anybody?

Sep
16
3 years ago
Activity icon

Started a new conversation Setting Up A Custom Domain - Am I Doing Something Wrong?

Hi,

I created a DigitalOcean droplet using Laravel Forge. Then, I Added the IP of the server as an A record using Godaddy, and when I ping my domain name, it does show me the IP address of the server.

Then I deleted the default website using Forge and created a new one with my domain. Doesn't matter how long I wait, I get this message when opening my domain with my browser:

This site can’t be reached
naxonhost.com refused to connect.

A couple of times it also showed me a connection timeout error.

Am I forgetting something here?

Aug
27
3 years ago
Activity icon

Replied to Laravel Internal Server (localhost:8000) Vs. XAMPP/WAMP - Use Of Paths

You should use the internal laravel server with php artisan serve . When going live, you have many options:

  1. If you're using a VPS, you won't have any problem.
  2. If you're using a shared hosting account, you can do one of the following:

Just a little note about option number 2: ALWAYS put all of your directories except for the public directory under the document root of your account so it won't be accessible by your site visitors (for security reasons).

Hope I helped :)

Aug
26
3 years ago
Activity icon

Started a new conversation Upgrading Laravel 5.3.0-Dev To Laravel 5.3.4

Is there a simple option for upgrading from 5.3.0-Dev to 5.3.4? Something like via composer?

Activity icon

Started a new conversation Can't Call Auth::user() On Controller's Constructor

I'm trying to check if the user has permission to a certain model. Up until now (with Laravel 5.2), I added this code at the constructor:

public function __construct()
{
    if (!Auth::user()->hasPermission('usergroups')) {
        abort(404);
    }
}

Now, after upgrading to Laravel 5.3,Auth::user() returns null when being called from the controller's constructor. If I call it within any other method of the class, it returns the currently logged in user.

Any Ideas why?

Aug
12
3 years ago
Activity icon

Started a new conversation Can I Install A Full-featured Laravel 5.3 Project

Hi, short question - by running "composer create-project laravel/laravel laravel53 dev-develop" - do I get a all of the features coming with laravel 5.3, or there are some more features to be added before release?

The reason I'm asking is that I'm currently building a website using Laravel 5.2, and the website isn't yet up, so if there's a fully featured laravel 5.3 installation available (I read somewhere that all there is to do is the documentation) - I thought why shouldn't I upgrade to 5.3...

Thank's!

Jul
30
3 years ago
Activity icon

Started a new conversation Team-Game Relationship

I'm building a website that involves a schedule of basketball games. I have 2 tables for this: teams and games.

As for the relationships between the models. For Game I got this:

public function homeTeam()
{
    return $this->belongsTo('App\Team\Team', 'home_team');
}

public function awayTeam()
{
    return $this->belongsTo('App\Team\Team', 'away_team');
}

But what should I do for the Team model? By the games() method inside it, I want to get all the team's games, home and away, and for this I need to reference both home_team and away_team columns on the games table.

My table structure:

teams
-------
id (int, primary)
name (varchar[255])

games
-------
id (int, primary)
home_team (int - references `id` on `teams`)
away_team (int - references `id` on `teams`)
date (datetime)
home_score (int)
away_score(int)
Jul
29
3 years ago
Activity icon

Started a new conversation Setting Elixir Not To Merge Css Files

Hi,

Is there a way to prevent elixir from merging my assets? For example:

mix.sass(['comingsoon/*.scss', 'comingsoon/**/*.scss'], 'public/assets/comingsoon/css')
        .scripts(['comingsoon/*.js', 'comingsoon/**/*.js'], 'public/assets/comingsoon/js');

I set this to compile all of my sass and js files, but I want to keep the files separate just the way I separate my pre-compiled files. For example, I have home.scss and contact.scss, I want them to be compiled into home.css and contact.css instead of them being merged to app.css.

Ho do I do that?

Jul
28
3 years ago
Activity icon

Replied to Browsersync Reloading The Page Instead Of Injecting Css

Figured this out also. I had to be specific about the files' extensions.

var elixir = require('laravel-elixir');
var gulp = require('gulp');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for our application, as well as publishing vendor resources.
 |
 */

elixir(function(mix) {
    mix.sass('comingsoon/soon.scss', 'public/assets/comingsoon/css/soon.css')
        .scripts('comingsoon/soon.js', 'public/assets/comingsoon/js/soon.js')
        .browserSync({
            files: [
                'app/*.*',
                'app/**/*.*',
                'public/assets/**/*.css',
                'public/assets/**/*.js'
            ],

            open: 'external',
            proxy: 'gate7.dev:81',
            host: 'gate7.dev',
            port: 80,
            notify: false
    });
});
Activity icon

Started a new conversation Browsersync Reloading The Page Instead Of Injecting Css

Hi,

So after my previous problem got solved, I'm now facing a different one. I'm using Browsersync to watch for file changes, and it works perfectly, but instead of injecting css changes, it realods the whole page whenever my css file is changed.

Here is my gulpfile:

var elixir = require('laravel-elixir');
var gulp = require('gulp');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for our application, as well as publishing vendor resources.
 |
 */

elixir(function(mix) {
    mix.sass('comingsoon/soon.scss', 'public/assets/comingsoon/css/soon.css')
        .scripts('comingsoon/soon.js', 'public/assets/comingsoon/js/soon.js')
        .browserSync({
            files: [
                'app/*.*',
                'app/**/*.*',
                'public/assets/**/*.*'
            ],

            open: 'external',
            proxy: 'gate7.dev:81',
            host: 'gate7.dev',
            port: 80,
            notify: false
    });
});
Activity icon

Replied to BrowserSync Not Watching For Css Or Js Changes

elixir(function(mix) {
    mix.sass('comingsoon/soon.scss', 'public/assets/comingsoon/css/soon.css')
        .scripts('comingsoon/soon.js', 'public/assets/comingsoon/js/soon.js')
        .browserSync({
            files: [
                'app/*.*',
                'app/**/*.*',
                'public/assets/**/*.*'
            ],

            open: 'external',
            proxy: 'gate7.dev:81',
            host: 'gate7.dev',
            port: 80,
            notify: false
    });
});

This worked.

Jul
27
3 years ago
Activity icon

Replied to BrowserSync Not Watching For Css Or Js Changes

Do I have to specify the folders and the files that I want browserSync to watch? If so, how can I do that?

Jul
25
3 years ago
Jul
24
3 years ago
Activity icon

Replied to BrowserSync Not Watching For Css Or Js Changes

Still not working...

var elixir = require('laravel-elixir');
var gulp = require('gulp');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for our application, as well as publishing vendor resources.
 |
 */

elixir(function(mix) {
    mix.sass('comingsoon/soon.scss', 'public/assets/comingsoon/css/soon.css')
        .scripts('comingsoon/soon.js', 'public/assets/comingsoon/js/soon.js')
        .browserSync({
        proxy: 'gate7.dev',
        notify: false
    });
});
Jul
23
3 years ago
Activity icon

Replied to BrowserSync Not Watching For Css Or Js Changes

tried it with localhost... didn't work as well.

Activity icon

Replied to Building A Modular Cms With Laravel

Can you show me an example?

Activity icon

Started a new conversation Building A Modular Cms With Laravel

Hello,

I'm currently working on a modular CMS for my website, and I need help with finding the correct way of doing it. I found 2 packages for that:

  1. https://github.com/caffeinated/modules
  2. https://github.com/nWidart/laravel-modules

First of all, which one is better for that?

Secondly, A thing that I need help figuring out: Let's take for example 2 modules: Article and Comment, which are separately installed, and there needs to be a relationship between them. Is there any way of automatically defining a relationship between two modules without the need to edit the model files every time I install a new module?

Daniel.

Jul
22
3 years ago
Activity icon

Started a new conversation BrowserSync Not Watching For Css Or Js Changes

Hi everybody,

I set up BrowserSync to watch my files, and it works perfectly with my blade templates, controllers, models etc...But it's not live reloading when I'm updating my css \ js files inside the resources/assets folder.

Here is my gulpfile:

var elixir = require('laravel-elixir');
var gulp = require('gulp');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for our application, as well as publishing vendor resources.
 |
 */

elixir(function(mix) {
    mix.browserSync({
        open: 'external',
        proxy: 'gate7.dev:81',
        host: 'gate7.dev',
        port: 80,
        notify: false
    });

    mix.sass('comingsoon/soon.scss', 'public/assets/comingsoon/css/soon.css');
    mix.scripts('comingsoon/soon.js', 'public/assets/comingsoon/js/soon.js');
});
Jul
05
3 years ago
Activity icon

Replied to Laravel 5.2 - Getting A Pivot Table Additional Attribute

It worked... Where is the official documentation about it for laravel 5.2?

Jul
04
3 years ago
Activity icon

Started a new conversation Laravel 5.2 - Getting A Pivot Table Additional Attribute

I'm using Laravel to track Gear in Wearhouses. For that I have 2 tables: gears and wearhouses, and another pivot table: gear_wearhouse.

The relationship between the two tables is a many-to-many relationship, and in my pivot table, in addition to the gear_id and wearhouse_id columns, I have a qty (quantity) column.

Now I loaded all the wearhouses that store a certain gear item ($whs = $gear->wearhouses), and I want to get the quantity (qty field) from the pivot table.

Here is my code:

foreach ($gear->wearhouses as $wh) echo $wh->pivot->qty;

$wh->pivot->qty returns nothing (null).

How can I do that the easiest way?

Jun
20
3 years ago
Activity icon

Replied to Running Socket.io Server On Shared Hosting With Ssh Access

is there a tutorial for running binding to a certain port?

Activity icon

Started a new conversation Running Socket.io Server On Shared Hosting With Ssh Access

Hi,

I have a VPS server with DirectAdmin installed, hostname would be hostname.com for example.

I created an account with the domain socket.hostname.com . Now I want to create a running node.js server with socket.io so I'll be able to create a chat application using Laravel calling and sending requests to this socket.io server .

How do I do that?