Buy your loved one the ultimate gift. Lifetime gift certificates are $100 off.

codemode

Experience

10,190

0 Best Reply Awards

  • Member Since 11 Months Ago
  • 83 Lessons Completed
  • 0 Favorites

10th December, 2017

codemode left a reply on Getting The Right Validation Error • 6 days ago

facepalm.. The field names where different.

codemode left a reply on Getting The Right Validation Error • 6 days ago

@Snapey , i get the same error this way too. (using L5.5)

codemode left a reply on Pulling In Old Data On Form Input After Validation Error • 6 days ago

Thanks again @Snapey , it works!

codemode started a new conversation Getting The Right Validation Error • 6 days ago

I have a controller, where i have done vlaidation like -

$this->validate(request(), [
            'title' => 'required|string|max:100',
            'description' => 'required|string|max:10000'
  ]); 

When i post the form with the title more than 100 characters (and description with valid no. of chars), i get the flash error as - ERROR : The title field is required. ERROR : The description field is required.

Should't it say something like "Error: The title has more than 100 characters" ?

I'm displaying the errors on my views like -

@if ($errors->any())
@foreach ($errors->all() as $error)
            <b>Error :</b> {{ $error }}
@endforeach 
@endif

How can i display the right error? Thanks!

codemode started a new conversation Pulling In Old Data On Form Input After Validation Error • 6 days ago

Hello,

Here - https://laravel.com/docs/5.5/requests#old-input , it says i can pull in the old inputted value like <input type="text" name="username" value="{{ old('username') }}">

..which works good for input type text, but does not work for textareas.

I do not get the data back when i do - <textarea class="form-control" name="post-description" value="{{ old('post-description') }}" placeholder="Description" rows="10" required></textarea>

Ideas?

Thanks!

8th December, 2017

codemode left a reply on General Doubts On Standard Login Blade Template Generated By Laravel • 1 week ago

I see..

So i think the following code will add the css class "has-error", in case of an error.

form-group{{ $errors->has('email') ? ' has-error' : '' }}

But then why do we have these two separate, since we are displaying just a common error? -

{{ $errors->first('password') }}

{{ $errors->first('email') }}

Thanks.

codemode started a new conversation General Doubts On Standard Login Blade Template Generated By Laravel • 1 week ago

Hello,

Following is the file generated by the make:auth artisan command.

<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
                            <label for="email" class="col-md-4 control-label">E-Mail Address</label>

                            <div class="col-md-6">
                                <input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required autofocus>

                                @if ($errors->has('email'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('email') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
                            <label for="password" class="col-md-4 control-label">Password</label>

                            <div class="col-md-6">
                                <input id="password" type="password" class="form-control" name="password" required>

                                @if ($errors->has('password'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('password') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

1.) What condition is form-group{{ $errors->has('email') ? ' has-error' : '' }} - this is the first line of the code above.

2.) How does this -

@if ($errors->has('email'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('email') }}</strong>
                                    </span>
@endif

..differ to this -

@if ($errors->has('password'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('password') }}</strong>
                                    </span>
 @endif

The way it seems, is that irrespective of weather email, or password is wrong, i get a message "wrong credentials" - be it email or password wrong.

What errors would the 2nd part of point 2 display?

Thanks!

17th November, 2017

codemode left a reply on How Many Javascript Frameworks Should I Learn That Is "enough"? • 4 weeks ago

Sure, you'll be capable enough if you're good with HTML, CSS, Laravel & VueJs. You can build any web application using those technologies. Ofcourse, there'll be always different opinions on it, but in general, yes that is quite sufficient.

As for JS frameworks, there will never be an "enough". JS frameworks are evolving rapidly, and every few months there'll be new stuff coming.

If you're focusing on Laravel, i think VueJs is a very convenient choice (although any other will work too).

Just keep the pace and keep learning, you'll get there :) Good luck!

9th November, 2017

codemode left a reply on Passing Dynamic Title Tags • 1 month ago

Thanks @Stratos , is there anyway we can confirm this?

8th November, 2017

codemode left a reply on Passing Dynamic Title Tags • 1 month ago

...just found that removing the {{ }} will remove the XSS protection that blade provides - https://laravel.com/docs/5.5/blade#displaying-data

Any thoughts?

codemode left a reply on Passing Dynamic Title Tags • 1 month ago

Ah, i missed the brackets.

So, this is the right format! - @section('title', $post->title ) , and it works! Thanks!

codemode left a reply on Passing Dynamic Title Tags • 1 month ago

@topvillas sorry for the confusion, on doing a simple @section('title', {{ $post->title }}) , i get a syntax error.

I.e. on using quotes, i see the php syntax on my title, and without quotes, i see an error.

codemode started a new conversation Passing Dynamic Title Tags • 1 month ago

Hello,

In the laravel docs, there is an example to pass different values to the tag as seen here - https://laravel.com/docs/5.5/blade#extending-a-layout

However, if i do something like @section('title', '{{ $post->title }}') on a page extending a master page, i get a syntax error.

I understand i can do a <title>{{ $post->title }}</title> , but that doesn't seem right if i'm defining the title as <title>@yield('title')</title> in my master page.

Is there a way i can pass dynamic values using @section, @yield and {{$value}} ?

Thanks!

7th November, 2017

codemode left a reply on Aligning Main Section And Sidebar To One Row • 1 month ago

Thanks Cronix. I wanted to keep all posts separate in each panel.

Putting the loop right after the col-md-8 did it, like this -

        <div class="col-md-8">
            @foreach ($posts as $post)
            <div class="panel panel-default">

codemode started a new conversation Aligning Main Section And Sidebar To One Row • 1 month ago

Hi,

Sorry for posting here, but my question is more about bootstrap and blade. In my blade.php file, i need to display all individual posts in a col-md-8 , and a sidebar with col-md-4 - so both of these sections could be aligned at the top side to side.

But, the current setup i have makes the sidebar appear at the bottom instead of the top. I can't really place the sidebar between the blade's foreach loop, since that will replicate the sidebar.

I think i'm placing the col-md's wrong. Below is my code -

@section('all-posts')
<div class="container">
    <div class="row">
        @foreach ($posts as $post)
        <div class="col-md-8">
            <div class="panel panel-default">
                <a href="/posts/{{ $post->id }}/{{ $post->slug }}">
                    <div class="panel-heading">{{ $post->title }} </div>
                </a>
                <p>{{ $post->description }}</p>
                        <p>by 
                            @if(!empty($post->user->name)) 
                                {{ $post->user->name }} 
                            @else
                                 Anonymous
                            @endif
                        </p> 
            </div>
        </div>
        @endforeach
        
         <div class="col-md-4">
                <div class="panel panel-default">
                    <div class="panel-heading">Sidebar</div>
                    @include('layouts/sidebars/latest-comments')
                </div>
        </div>
        </div> 
    </div> 

Thanks.

27th October, 2017

codemode left a reply on How To Handle Url Changes Upon Editing • 1 month ago

Hi @Talinon I need the slug in the id

codemode left a reply on How To Handle Url Changes Upon Editing • 1 month ago

Thanks @Daveismyname , but hardcoded redirects would not be the best idea here. It's better to dynamically set the redirect when a post is edited.

codemode started a new conversation How To Handle Url Changes Upon Editing • 1 month ago

Hi,

In my little project, i am displaying the url of a post with the id and the slugged title, like - website.com/5/the-fifth-title

The slug is generated by the str_slug() method (https://laravel.com/docs/5.5/helpers#method-str-slug)

Now, when a user edits the post, and the title changes to something like "The modified fifth title" - the title will change to website.com/5/the-modified-fifth-title

In such a case, though my website links will be aware of this change, but not the search engines.

What would be the best approach to automatically redirect the old url to the new url?

Many thanks!

20th October, 2017

codemode left a reply on Allowing Only Certain Values To Be Accepted On A Dropdown • 1 month ago

:O Dude, that god-damn worked!

codemode started a new conversation Allowing Only Certain Values To Be Accepted On A Dropdown • 1 month ago

I have a simple dropdown to choose the gender on the registration form like -

<select name="gender" class="col-md-4 control-label">
        <option value="male">Male</option>
         <option value="female">Female</option>
 </select>

But, when i change the values on chrome's inspection tools, i can easily modify the values and can store on the DB.

How can i restrict the values only to male and female.

Is there a way i can add a condition to my Controller's validation?

protected function validator(array $data)
    {
        return Validator::make($data, [
            'name' => 'required|string|max:255',
            'email' => 'required|string|email|max:255|unique:users',
            'password' => 'required|string|min:6|confirmed',
            'gender' => 'required|string' //and add a condition for just "male" and "female"
        ]);
    }

Thanks

codemode started a new conversation Adding Fields To The Standard Register Controller • 1 month ago

Hi,

In a new laravel project i've done "make:auth" to make the authentication. I am trying to include two new fields "gender and dob".

Gender is required, and dob is optional.

RegisterController -

protected function validator(array $data)
    {
        return Validator::make($data, [
            'name' => 'required|string|max:255',
            'email' => 'required|string|email|max:255|unique:users',
            'password' => 'required|string|min:6|confirmed',
            'gender' => 'required|string'
        ]);
    }

    protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
            'gender' => $data['gender'],
     
        ]);
    }

Filled in fillables in the User model -

 protected $fillable = [
        'name', 'email', 'password', 'gender', 'dob'
    ];

And here is the migration file -

public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('email')->unique();
            $table->string('password');
            $table->string('gender');
            $table->string('dob')->nullable();
            $table->rememberToken();
            $table->timestamps();
        });
    }

Added this to the register.blade.php -

<div class="form-group{{ $errors->has('gender') ? ' has-error' : '' }}">
                            <label for="name" class="col-md-4 control-label">Gender</label>

                            <div class="col-md-6">
                                <select name="gender" class="col-md-4 control-label">
                                    <option value="male">Male</option>
                                    <option value="female">Female</option>
                                </select>
                                @if ($errors->has('name'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('gender') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

Upon doing the above, when i try to register a new user, i get - ErrorException (E_NOTICE) Undefined index: dob

Help please, thanks!

29th September, 2017

codemode left a reply on Route Duplicated • 2 months ago

Hi @Snapey thanks for your input. Could you explain the reason please? Cheers.

codemode left a reply on Route Duplicated • 2 months ago

Aha, got it. I'm using a cloud dev environment, and my vhosts root has more than one project, so i guess laravel was confused to find what the actual path is.

26th September, 2017

codemode left a reply on Route Duplicated • 2 months ago

I could run it with action="{{ $post->id }}/comments" ..but i don't get it. Where is the "posts" getting appended from?

codemode started a new conversation Route Duplicated • 2 months ago

I'm following this tut - https://laracasts.com/series/laravel-from-scratch-2017/episodes/16

..where a comment form has to be added on views/posts/show.blade.php like :

` {{ csrf_field() }} Add Comment

`

My CommentsController :

` class CommentsController extends Controller { public function store(Post $post) { Comment::create([

        'body' => request('body'),
        'post_id' => $post->id
        
    ]);

    return back();
}

} `

And the route file : Route::post('posts/{post}/comments', '[email protected]');

On submitting the form, i see the URL goes to 'localhost/posts/posts/1/comments' , instead of 'localhost/posts/1/comments'

Where am i going wrong? Thanks!

28th June, 2017

codemode left a reply on Using A Url Slug And Id On The Route • 5 months ago

@Demers94 and @Snapey Thanks a lot! This solves it!

codemode started a new conversation Taking A User's IP Address • 5 months ago

Hello,

I'm making a small web app, which does not have the concept of user login or registration.

There will be a post, and each post will have comments - both do not need user login / registration.

I want to avoid duplicate posts, do you think taking the IP address and checking the previous posts from that IP is a good way to go?

Laravel docs here - https://laravel.com/docs/5.4/migrations#columns , show to save IP addressed on the DB like $table->ipAddress('visitor');

And how can i retrieve the user's IP in order to save it on the DB?

Thanks!

17th June, 2017

codemode left a reply on Using A Url Slug And Id On The Route • 5 months ago

@topvillas - I understand. What i want to include is, the slug in the url.

codemode left a reply on Using A Url Slug And Id On The Route • 5 months ago

@topvillas - to avoid duplicate urls

codemode started a new conversation Using A Url Slug And Id On The Route • 5 months ago

Hello,

I'm trying to put the slug and id on the URL.

So, i have a Post model, with basic things like id, title, description. (example - 1 , first-title, first description)... and i want the URL to look like www.website.com/first-title_1

Route - ´´´Route::get('{slug}_{id}', '[email protected]');´´´

Controller - ´´´public function show(Post $id, $slug) { return $id; //or compact into a view // and use str_slug() on the $title }´´´

I'm not sure if i need to store the slug into the database, also i'm not sure how the passing of values for $id and $slug should be.

Any help please? Thanks!

25th February, 2017

codemode left a reply on JWT Token Based Authentication • 9 months ago

Agh, i don't know how the "tymon/jwt-auth": "0.5.*" was not saved on my composer.json . All good now.

codemode started a new conversation JWT Token Based Authentication • 9 months ago

Hello, I'm trying to use Token based authentication from - https://github.com/tymondesigns/jwt-auth/

As in the installation instructions in - https://github.com/tymondesigns/jwt-auth/wiki/Installation

When i do - php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\JWTAuthServiceProvider"

i see - [Symfony\Component\Debug\Exception\FatalThrowableError] Class 'Tymon\JWTAuth\Providers\JWTAuthServiceProvider' not found

Here is my app.php -

'providers' => [

        /*
         * Laravel Framework Service Providers...
         */
        Illuminate\Auth\AuthServiceProvider::class,
        Illuminate\Broadcasting\BroadcastServiceProvider::class,
        Illuminate\Bus\BusServiceProvider::class,
        Illuminate\Cache\CacheServiceProvider::class,
        Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
        Illuminate\Cookie\CookieServiceProvider::class,
        Illuminate\Database\DatabaseServiceProvider::class,
        Illuminate\Encryption\EncryptionServiceProvider::class,
        Illuminate\Filesystem\FilesystemServiceProvider::class,
        Illuminate\Foundation\Providers\FoundationServiceProvider::class,
        Illuminate\Hashing\HashServiceProvider::class,
        Illuminate\Mail\MailServiceProvider::class,
        Illuminate\Notifications\NotificationServiceProvider::class,
        Illuminate\Pagination\PaginationServiceProvider::class,
        Illuminate\Pipeline\PipelineServiceProvider::class,
        Illuminate\Queue\QueueServiceProvider::class,
        Illuminate\Redis\RedisServiceProvider::class,
        Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
        Illuminate\Session\SessionServiceProvider::class,
        Illuminate\Translation\TranslationServiceProvider::class,
        Illuminate\Validation\ValidationServiceProvider::class,
        Illuminate\View\ViewServiceProvider::class,
        Tymon\JWTAuth\Providers\JWTAuthServiceProvider::class,
'aliases' => [

        'App' => Illuminate\Support\Facades\App::class,
        'Artisan' => Illuminate\Support\Facades\Artisan::class,
        'Auth' => Illuminate\Support\Facades\Auth::class,
        'Blade' => Illuminate\Support\Facades\Blade::class,
        'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
        'Bus' => Illuminate\Support\Facades\Bus::class,
        'Cache' => Illuminate\Support\Facades\Cache::class,
        'Config' => Illuminate\Support\Facades\Config::class,
        'Cookie' => Illuminate\Support\Facades\Cookie::class,
        'Crypt' => Illuminate\Support\Facades\Crypt::class,
        'DB' => Illuminate\Support\Facades\DB::class,
        'Eloquent' => Illuminate\Database\Eloquent\Model::class,
        'Event' => Illuminate\Support\Facades\Event::class,
        'File' => Illuminate\Support\Facades\File::class,
        'Gate' => Illuminate\Support\Facades\Gate::class,
        'Hash' => Illuminate\Support\Facades\Hash::class,
        'Lang' => Illuminate\Support\Facades\Lang::class,
        'Log' => Illuminate\Support\Facades\Log::class,
        'Mail' => Illuminate\Support\Facades\Mail::class,
        'Notification' => Illuminate\Support\Facades\Notification::class,
        'Password' => Illuminate\Support\Facades\Password::class,
        'Queue' => Illuminate\Support\Facades\Queue::class,
        'Redirect' => Illuminate\Support\Facades\Redirect::class,
        'Redis' => Illuminate\Support\Facades\Redis::class,
        'Request' => Illuminate\Support\Facades\Request::class,
        'Response' => Illuminate\Support\Facades\Response::class,
        'Route' => Illuminate\Support\Facades\Route::class,
        'Schema' => Illuminate\Support\Facades\Schema::class,
        'Session' => Illuminate\Support\Facades\Session::class,
        'Storage' => Illuminate\Support\Facades\Storage::class,
        'URL' => Illuminate\Support\Facades\URL::class,
        'Validator' => Illuminate\Support\Facades\Validator::class,
        'View' => Illuminate\Support\Facades\View::class,
        'JWTAuth'   => Tymon\JWTAuth\Facades\JWTAuth::class,
        'JWTFactory' => Tymon\JWTAuth\Facades\JWTFactory::class

    ],

Your help is appreciated!

20th February, 2017

codemode left a reply on Basics Of Vue • 9 months ago

Got it, i was referring the root element on a div above the element. On providing the root id to the , it's all good.

codemode started a new conversation Basics Of Vue • 9 months ago

I'm on this tutorial https://laracasts.com/series/learn-vue-2-step-by-step/episodes/19

The view file -

 <input type="text" name="peso" class="form-control" v-model="peso" />
 <input type="text" name="altura" class="form-control" v-model="altura" />

Added CDN files before the ending body tag-

<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    
 <script src="https://unpkg.com/[email protected]/dist/vue.js"></script>
  
 <script src="/js/app.js"></script>

Content of app.js -

new Vue({
    
    el: '#result',
    
    data: {
      
    },
    
    methods: { 
        
    }
    
});

Note that i have not currently defined ´peso´ and ´altura´ in my data. Which should give errors on my console. I get none :| ..

Besides, i have installed the Vue DevTool extension on my chrome, and after i define the data fields like -

new Vue({
    
    el: '#result',
    
    data: {
      peso: '',
    altura: ''
    },
    
    methods: { 
        
    }
    
});

... i do not see the reactive values reflecting in my Vue DevTools. What am i missing? Thanks!

19th February, 2017

codemode left a reply on No Redirect After Form Submission • 9 months ago

@jlrdw If such little things get you, then you really need to calm your nerves a bit. Again, i'm not here to continue a silly conversation on personal decisions. You seem to be having a bad day today.. i wish you a better rest of the day.

codemode left a reply on No Redirect After Form Submission • 9 months ago

@jlrdw Dude, i have no idea why you'd blow your steam on something that others are doing. This bothers you so much? just avoid it.

codemode left a reply on No Redirect After Form Submission • 9 months ago

@jlrdw everyone has their reasons to what they are doing. Yes there are better ways of doing things with time, but again - People sometimes have their reasons. Do you want me to write about my personal life, and proceedings here? No.

If this troubles you, please avoid writing, rather than typing something negative.

codemode left a reply on No Redirect After Form Submission • 9 months ago

@amitshrestha221 Yes the form is working fine, and no, {{}} are not really required in the action if you're not passing any dynamic values to the url.

codemode left a reply on No Redirect After Form Submission • 9 months ago

Anyone who can help here :( .... i need to show this code to an institute. I'll really appreciate it.

codemode left a reply on No Redirect After Form Submission • 9 months ago

Hi @Snapey , thank you for your reply. Could you give me a simple example for this code (i'm still new to laravel) -

View -

<form method="POST" action="check-imc">
                        <div class="form-group">
                            <label for="peso">Peso (Kg) : </label>
                            <input type="text" name="peso" class="form-control"/>
                            <label for="altura">Altura (m) : </label>
                            <input type="text" name="altura" class="form-control"/>
                            <br />
                            <input type="hidden" name="_token" value="{{ csrf_token() }}">
                            <input type="submit" value="Enviar" class="btn btn-primary pull-right"/>
                        </div>
                    </form>

Controller -

public function store(Request $request)
    {
        $imc = new Imc;
        $imc->peso = $request->peso;
        $imc->altura = $request->altura;
        $altura2 = ($imc->altura) * ($imc->altura);
        $imc->imccalculado = ( $imc->peso / $altura2 );
    
    $imc->save();
    
     }

So the value of $imc->imccalculado should be displayed on the view file without refreshing..

Thanks a lot!

codemode started a new conversation No Redirect After Form Submission • 9 months ago

Hello, I have a very simple form -

<form method="POST" action="check-imc">
                        <div class="form-group">
                            <label for="peso">Peso (Kg) : </label>
                            <input type="text" name="peso" class="form-control"/>
                            <label for="altura">Altura (m) : </label>
                            <input type="text" name="altura" class="form-control"/>
                            <br />
                            <input type="hidden" name="_token" value="{{ csrf_token() }}">
                            <input type="submit" value="Enviar" class="btn btn-primary pull-right"/>
                        </div>
                    </form>

And i have a post route like - Route::post('check-imc', '[email protected]')

In which there is store function, which stores the data.

I do not want to redirect/refresh after i click the submit button. Is that possible? Thanks!

codemode started a new conversation Fetching The Last Entry • 9 months ago

Hello,

I am trying to extract the last made entry by a particular user on my controller. This is what i currently have -

$all = Imc::where('user_id', Auth::id())->get();
$last = collect($all)->last();
 return $last;

Though this works, but i'm sure there is a better way to extract just that one last entry, rather than extracting all, and then refining the last.

Thanks!

18th February, 2017

codemode started a new conversation Pagination Error • 9 months ago

I'm trying to paginate my view, but i get this error - Call to undefined method Illuminate\Database\Query\Builder::links()

Controller function -

public function index()
    {
        
        $imc_obj = Imc::where('user_id', Auth::id())->paginate(5);
      
        return view('imc.index', compact('imc_obj'));
        
        
    }

View file -

@foreach ($imc_obj as $imcs)
                      <tr>
                        <td>{{ $imcs->name }}</td>
                        <td>{{ date('F d, Y', strtotime($imcs->created_at)) }}</td>
                        
                      </tr>
                        @endforeach
                    </tbody>
                  </table>
                  {{ $imcs->links() }}

codemode left a reply on Displaying Posts Just To The Owner Of The Post • 9 months ago

Got it.. thanks guys!

(ps, i have no idea where the accept answer button went)

codemode left a reply on Displaying Posts Just To The Owner Of The Post • 9 months ago

Thanks @tykus and @Cronix Meanwhile i was reading the documentation, and one of the ways was just -

$imc_obj = Imc::where('user_id', Auth::id())->get();

...in my index() function on the controller, as Cronix suggested. Sweet.

However, i just tested @tykus method, and that works too! Though i did not understand what is the imcs() in $imc_obj = Auth::user()->imcs()->get();

Let's break it down... Auth::user() gives the object of the current logged in user. Is imcs() an object of all imcs? Where is this value coming from?

Thanks!

codemode started a new conversation Displaying Posts Just To The Owner Of The Post • 9 months ago

Hi, I'm doing a small test in which users can fill in a form, and post some information. I'd like the users to be able to see only their own posted information, and not what others has posted.

Here is the route -

Route::get('imcs', '[email protected]');

This triggers the index function on my controller which looks like -

public function index()
    {
        $imc_obj = Imc::all();

        return view('imc.index', compact('imc_obj'));
    }

And this returns the object on the view, which i iterate to display all results as -

 @foreach ($imc_obj as $imc)

$imc->text

@endforeach

How can i show only those posts to the person who has made specific posts? Many thanks!

codemode left a reply on Basic Qs - Saving An Object To A User Related Table • 9 months ago

Thanks @tykus and @futuremandigital .. you guys are awesome!

codemode left a reply on Basic Qs - Saving An Object To A User Related Table • 9 months ago

@tykus My brain hurts a bit lol. Yes, you're right... i should not pass a $task->id . My mistake.

If it's not too much to ask, can you tell me, when i create a new task, how will i be able to associate this to a logged in user?

codemode left a reply on Basic Qs - Saving An Object To A User Related Table • 9 months ago

@tykus No, sorry, i guess i did not explain well. I am trying to access form.blade.php

Just on accessing this file from my browser i get this error.. i can't even see the form yet.

And on this blade file i have a tag, whose action contains $task - which laravel is not able to identify.

All in all, i am trying to create a new task.

Edit Your Profile
Update

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