davy_yg

Experience

28,630

0 Best Reply Awards

  • Member Since 6 Months Ago
  • 181 Lessons Completed
  • 0 Favorites

19th October, 2017

davy_yg started a new conversation Replacing Route::controller • 1 hour ago

Hello,

I think part of my route only works in Laravel 5.1 such as:

Route::controllers([
        'auth' => 'Auth\AuthController',
        'password' => 'Auth\PasswordController',
        'home'=>'HomeController',
        'member'=>'MemberController',
        'mail'=>'MailController',
        'social'=>'SocialController',
        'ajax'=>'AjaxController',
        'api'=>'ApiController',
        'timeline'=>'TimelineController',
        'setting'=>'SettingController',
    //    'ecommerce'=>'EcommerceController',
        'test'=>'TestController',
]);

What can I replace these routes with so that it would works for both Laravel 5.1 and Laravel 5.5 ?

davy_yg left a reply on Should I Stick With Resource Controller? • 1 hour ago

You can stick with resource controller since it has a complete function for you to start with. You also can add more functions in it when you need to and add another route to the resource controller when you need to.

davy_yg started a new conversation Hide And Show Some Content • 1 hour ago

Hello,

I have been trying to hide and show css with button click:

home.blade.php

    #container{
      display: grid;
      grid-template-columns: 350px auto 300px;
      grid-template-rows: 800px 800px 800px;
      grid-template-areas:
            "menu cont sidenav";
      position: fixed;      
      z-index: 1;
      color: black;
    }
    menu {
      grid-area: menu; 
    }
    cont{
      grid-area: cont;
      background: white;
      padding: 50px;
    }
    cont p{ color:black; }
    sidenav {
      grid-area: sidenav;
      background: orange;
      padding: 50px;
      color: black;
    }
    ...
    <li>
                            <input id="c10" type="checkbox">
                            <label for="c10">
                                <a href="{{ action('[email protected]') }}" onclick="hidePages()">
                                    @if($uri=="home/articles")
                                        <!-- <img src="{{url("")}}/images/button-10-hover.png"/> -->
                                        <div id="circle1"><div style="margin: -10px 0 0 0;"><img src="{{url("")}}/images/add/icons5-hover.png" width="30px" /></div></div>
                                    @else
                                        <!-- <img src="{{url("")}}/images/button-10.png"/> -->
                                        <div id="circle1"><div style="margin: -10px 0 0 0;"><img src="{{url("")}}/images/add/icons5.png" width="30px" /></div></div>
                                    @endif
                                </a>
                            </label>
                        </li>
                        <li>
    ...
    <script>
function hidePages() {
    var x = document.getElementById("container");
    if (x.style.display === "none") {
        x.style.display = "block";
    } else {
        x.style.display = "none";
    }
}
</script>

pages.blade.php

<section id="container">
    <menu></menu> 
    <cont>
        <center><b>{{ $pages2->pages_title }}</b></center><br> 
        {!! $pages2->pages_content !!}
    </cont>
    <sidenav>
        @foreach( $pages as $p) 
        <a href="{{url('')}}/home/pages/{{ $p->id }}">{{ $p->pages_name }}</a><br><br>    
        @endforeach 
    </sidenav>
</section>    

I am using the grid system. Since it only works in while I need to use to make the grid system works. now what should I do? I need to hide whole whole container since it is overlapping the articles.

Well I already try using the and it still does not hide the content under it.

18th October, 2017

davy_yg left a reply on Handling Html Tag • 23 hours ago

It finally works. I deleted the page that looks chaos and create a new page. This time it looks good.

davy_yg left a reply on Handling Html Tag • 1 day ago

I am not sure about the syntax.

<?php echo nl2br({{ $pages2->pages_content }}); ?>

I also do not want to print the html tag.

So far:

pages.blade.php

<section id="container">
    <menu></menu> 
      
            
    <cont>

        
        <center><b>{{ $pages2->pages_title }}</b></center><br> 

        {!! $pages2->pages_content !!}
                    
    </cont>

    <sidenav>

        @foreach( $pages as $p)
        
        <a href="{{url('')}}/home/pages/{{ $p->id }}">{{ $p->pages_name }}</a><br><br>    
                               
        @endforeach

    </sidenav>
  

    </section>           

The first page looks good. Now on the second page. It seems like page started to restructure.

If I inspect element I see sidenav goes inside cont

  <cont>

        
        <center><b>{{ $pages2->pages_title }}</b></center><br> 

        {!! $pages2->pages_content !!}
                    
    
    <sidenav>

        @foreach( $pages as $p)
        
        <a href="{{url('')}}/home/pages/{{ $p->id }}">{{ $p->pages_name }}</a><br><br>    
                               
        @endforeach

    </sidenav>


</cont>

    

davy_yg left a reply on Handling Html Tag • 1 day ago

If I do that the text start to disappear and the page turn into chaos.

17th October, 2017

davy_yg started a new conversation Handling Html Tag • 1 day ago

Hello,

How to handle html tag in laravel?

I input my text with wysiwig editor which store html in the database. When I show my text output it actually prints out the html tag which doesn't looks good.

For example:

Far far away, behind the word mountains2

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean.

Pages.blade.php

<menu></menu> 
      
            
    <cont>

        
        <center><b>{{ $pages2->pages_title }}</b></center><br> 

        {{ $pages2->pages_content }}
                    
    </cont>

I expect that it hides the html tag and shows the wysiwig text right away without the html syntax.

How to do so?

Thanks in advance.

davy_yg left a reply on Showing Page • 1 day ago

Just solved it.

pages.blade.php

<?php

$url = $_SERVER['REQUEST_URI'];
$pos = strrpos($url, '/');
$id = $pos === false ? $url : substr($url, $pos + 1);   

$pages2 = \Soulfy\Pages::where('id', $id)->first();
                                                
?>

@extends('home')

@section('title', 'Home')


@section('content')


    <section id="container">
    <menu></menu> 
      
            
    <cont>

        
        <center><b>{{ $pages2->pages_title }}</b></center><br> 

        {{ $pages2->pages_content }}
                    
    </cont>

davy_yg left a reply on Showing Page • 2 days ago

In my case I think I should use {!! $users->render() !!} since it's laravel 5.1

Even so it's still displaying the same error. I try using link() and the error remains the same.

<section id="container">
    <menu></menu> 
      

    <cont>

        @foreach( $pages as $page)

        <center><b>{{ $page->pages_title }}</b></center><br> 

        {{ $page->pages_content }}

        @endforeach


        {!! $page->render() !!}

    </cont>

    

    <sidenav>

        @foreach( $pages as $p)
        
        <a href="{{url('')}}/home/pages/{{ $p->id }}">{{ $p->pages_name }}</a><br><br>    
                               
        @endforeach

    </sidenav>
  

    </section>

davy_yg left a reply on Showing Page • 2 days ago

ErrorException in Builder.php line 2123: Call to undefined method Illuminate\Database\Query\Builder::renders() (View: C:\xampp\htdocs\soulfy_repo\framework\resources\views\soulfy\pages.blade.php)

I am not sure how to define the pagination where to place it.

Looks like the error goes to the view.

davy_yg left a reply on Showing Page • 2 days ago

Now, I cannot think how to alternate the page number: home/pages/1, home/pages/2 etc. for each new pages.

Also everytime the page link being click I must see the page article being pull out.

PageController.php

public function frontindex()
   {
    // page on frontpage

    $domain = $_SERVER['SERVER_NAME'];
    $user = User::where('domain', $domain)->first();  
    
    $pages = Pages::where('user_id', $user->id)->get();
    
    return view('soulfy.pages', ['pages' => $pages]);

   }

pages.blade.php

<section id="container">
    <menu></menu> 
      
    <cont>
        <center><b></b></center><br> 

                       
    </cont>        
    <sidenav>

        @foreach( $pages as $page)
        
        <a href="{{url('')}}/home/pages/1">{{ $page->pages_name }}</a><br><br>    
                               
        @endforeach
        
    </sidenav>
  

    </section>  

davy_yg left a reply on Showing Page • 2 days ago

Is not working.

dd result:

"id" => 1 "user_id" => 43 "pages_name" => "Page #1" "pages_title" => "Far far away, behind the word mountains" "pages_content" => "

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic&" "updated_at" => "2017-10-17 02:35:41" "created_at" => "2017-10-12 09:54:24" ]

davy_yg left a reply on Showing Page • 2 days ago

I try typing

 <?php dd($user) ?> 

on apages.blade.php and I can see the user.

PageController.php

public function frontindex()
    {
        // page on frontpage

        $domain = $_SERVER['SERVER_NAME'];
        $user = User::where('domain', $domain)->first();  
    
        $pages = Pages::where('user_id', $user->id)->get()->first();
    
        return view('soulfy.pages', ['pages' => $pages]);

    }

Now, is it still a collection after using ->first();

pages.blade.php

<section id="container">
    <menu></menu> 
      
    <cont>
        <center><b>Title: {{ $pages->title }}</b></center><br> 

        Content :{{ $pages->content }}
           
    </cont>        
    <sidenav>

        {{ $pages->pages_name }}<br><br>
        Category #2<br><br>
        Category #3<br><br>
    </sidenav>
  

    </section>    

Now, I can only see {{ $pages->pages_name }}, I wonder why the title and content don't appear while they are in the database.

davy_yg left a reply on Deleting Pages • 2 days ago

I have to use: {{ method_field('DELETE') }}

instead of: {{ method_field('PUT') }}

only {{ method_field('DELETE') }} works.

Thanks anyway.

davy_yg left a reply on Showing Page • 2 days ago

i can't understand where all the data goes since the data seems to be empty:

@foreach($pages as $page) 
<section id="container">
    <menu></menu> 
      
    <cont>
        <center><b>{{ $page->title }}</b></center><br> 

        {{ $page->content }}
           
    </cont>        
    <sidenav>

        {{ $page->pages_name }}<br><br>
        Category #2<br><br>
        Category #3<br><br>
    </sidenav>
  

</section>    
 @endforeach 

Yet, if I type it shows something.

I can't even see the {{ $page->pages_name }} which located right above Category #2.

davy_yg left a reply on Deleting Pages • 2 days ago

It deletes all the data except for

id user_id 3 43

Which leave the edit and delete button behinds since the id and user_id still exist.

16th October, 2017

davy_yg started a new conversation Showing Page • 2 days ago

ErrorException in 7acfe019ded6ab1ceaef14a2b1b3e25f line 30: Undefined property: Illuminate\Database\Eloquent\Collection::$title (View: C:\xampp\htdocs\soulfy_repo\framework\resources\views\soulfy\pages.blade.php)

Line 30: Even the all-powerful Pointing {{ $pages->title }}

pages.blade.php

<section id="container">
    <menu></menu>    
    <cont>
        <center><b>Even the all-powerful Pointing {{ $pages->title }}</b></center><br> 

        {{ $pages->content }}
        
    </cont>        
    <sidenav>

        {{ $pages->pages_name }}<br><br>

PageController.php

public function frontindex()
    {
    // page on frontpage

    $domain = $_SERVER['SERVER_NAME'];
    $user = User::where('domain', $domain)->first();  
    
    $pages = Pages::where('user_id', $user->id)->get();
    
    return view('soulfy.pages')->with(['pages' => $pages]);

    }

davy_yg left a reply on Deleting Pages • 2 days ago

routes.php

Route::resource('pages', 'PageController');

davy_yg started a new conversation Deleting Pages • 2 days ago

Hello,

I wonder why I have been unable to delete data ?

If I press the delete button it start to open the edit page instead of deleting the page and remains on the same page (apages.blade.php).

PageController.php

public function destroy($id)
    {
        // Delete Data

        $pages = Pages::find($id);
        $pages->delete();

        $domain = $_SERVER['SERVER_NAME'];
        $user = User::where('domain', $domain)->first();  
        $pages = Pages::where('user_id', $user->id)->get();
    
        session()->flash('status', 'Page has been deleted');
        return view('soulfy.apages', ['pages' => $pages]);
    }

apages.blade.php

<div class="form-body  create-article">

                        @if(session()->has('status'))
                            <div class="alert alert-success"><em> {{ session('status') }}</em></div>
                        @endif

                    <a href="{{ route('pages.create')}}" class="btn btn-green" data-id="" data-tittle="" data-content="">Add Pages</a>

                    <div style="color: white;"><br><br>

                    @foreach($pages as $page)
                        {{ $page->pages_name }}
                    
                        <!-- btn-act-edit -->
                        <a href="{{ route('pages.show', $page->id) }}" class="btn btn-green" data-id="" data-tittle="" data-content="">Edit</a>
                        <a href="{{ route('pages.destroy', $page->id) }}" class="btn btn-green" data-id="" data-tittle="" data-content="">Delete</a><br><br>

                    @endforeach
                    
                    </div>
     </div>

davy_yg left a reply on Parse Error: Syntax Error, Unexpected 'field' (T_STRING) • 2 days ago

Thanks now it has no error. It's just don't really update the database. The data remains the same.

PageController.php

public function update(Request $request, $id)
{
        // Update Data

        $pages = Pages::find($id);
        $pages->pages_name = $request['pages_name'];
        $pages->pages_content = $request['pages_content'];
        $pages->update();

        session()->flash('status', 'Page has been updated');    
        return view('soulfy.edit_pages', ['pages' => $pages]);

    }

edit_pages.blade.php

<form action="{{ route('pages.update', $pages->id) }}" method="post">
                        {{ csrf_field() }} {{ method_field('PATCH') }}

                    <div style="color: white;">Page Name: <input type="text" name="pages_name" size="10" value="{{ $pages->pages_name }}"><br><br></div>

                    <div style="color: white;">Page Title: <input type="text" name="pages_title" size="10" value="{{ $pages->pages_title }}"><br><br></div>
                        
                    <textarea id="particle" name="pages_content" rows="20" cols="70">
                    {{ $pages->pages_content }}</textarea><br><br>

                    </div></div> 

                    <div style="padding: 20px;"><input type="submit" class="btn btn-green" data-id="" data-tittle="" data-content="" value="Update"></div>

        </form>

15th October, 2017

davy_yg left a reply on Laravel Env Helper Function And Database.php • 3 days ago

Cek your database configuration:

config/database.php

davy_yg left a reply on Edit Pages Error • 3 days ago

Well, I actually have a laravel manual book from beginner up to intermediate level that I occasionally read. Coincidencely, it has similar problem with the problem that I am facing.

apages.blade.php

        @foreach($pages as $page)
                        {{ $page->pages_name }}
                    
                        <!-- btn-act-edit -->
                        <a href="{{ route('pages.show', $page->id) }}" class="btn btn-green" data-id="" data-tittle="" data-content="">Edit</a>
                        <a href="{{ route('pages.destroy') }}" class="btn btn-green" data-id="" data-tittle="" data-content="">Delete</a>

        @endforeach

PageController.php

 public function show($id)
 {
    // Edit Page

    $pages = Pages::find($id);
    
    return view('soulfy.edit_pages', ['pages' => $pages]);
 }

edit_pages.blade.php

      <form action="{{ route('pages.update', $pages->id) }}" method="post">
                        {{ csrf_field() }} {{ method field('PATCH') }}

                    <div style="color: white;">Page Name: <input type="text" name="pages_name" size="10" value="{{ $pages->pages_name }}"><br><br></div>

                    <div style="color: white;">Page Title: <input type="text" name="pages_title" size="10" value="{{ $pages->pages_title }}"><br><br></div>
                        
                    <textarea id="particle" name="pages_content" rows="20" cols="70">
                    {{ $pages->pages_content }}</textarea><br><br>

                    </div></div> 

                    <div style="padding: 20px;"><input type="submit" class="btn btn-green" data-id="" data-tittle="" data-content="" value="Update"></div>

                    </form>

I basically have to pass the page id to the edit page:

which I write it in the apages or admin pages, the page before the edit page:

    <a href="{{ route('pages.show', $page->id) }}"

davy_yg started a new conversation Parse Error: Syntax Error, Unexpected 'field' (T_STRING) • 4 days ago

ErrorException in df2cc2675ccd2db38941c825b30c3ebd line 56: Parse error: syntax error, unexpected 'field' (T_STRING), expecting ',' or ')' (View: C:\xampp\htdocs\soulfy_repo\framework\resources\views\soulfy\edit_pages.blade.php)

Line 56: {{ csrf_field() }} {{ method field('PATCH') }}

<form action="{{ route('pages.update', $pages->id) }}" method="post">
                        {{ csrf_field() }} {{ method field('PATCH') }}

                    <div style="color: white;">Page Name: <input type="text" name="pages_name" size="10" value="{{ $pages->pages_name }}"><br><br></div>

                    <div style="color: white;">Page Title: <input type="text" name="pages_title" size="10" value="{{ $pages->pages_title }}"><br><br></div>
                        
                    <textarea id="particle" name="pages_content" rows="20" cols="70">
                    {{ $pages->pages_content }}</textarea><br><br>

                    </div></div> 

                    <div style="padding: 20px;"><input type="submit" class="btn btn-green" data-id="" data-tittle="" data-content="" value="Update"></div>

                    </form>

Since I am using route::resource for the controller, for update it will be route::patch but then I am getting that error.

How to fix it?

14th October, 2017

davy_yg left a reply on Running Composer On Server • 4 days ago

Is migration only be able to run from the composer?

davy_yg left a reply on Edit Pages Error • 4 days ago

I have actually watch all of that series.

I only watch the second time:

Episode 5 - Pass Data to Your Views Episode 2 - Basic Routing and Views

I only don't understand how do I get the $id from views?

I think the context in the videos is different.

davy_yg started a new conversation Running Composer On Server • 4 days ago

Hello,

My company subscribe a webhosting from a webhosting company.

I wonder if I can migrate tables on server. Like if I am on localhost I can use composer to do that. What about online on the server?

Someone mentions using putty, but I am using sharehosting which my web hosting tech support mentions that it is not allowed on share hosting.

davy_yg left a reply on Edit Pages Error • 4 days ago

This is the part that's I am really confuse right now, I know how to do it in php. Like If I rewrite the database calling syntax in my view such as:

$pages = App\Pages::find($id);

Will it be able to detect the $id since I am getting the error.

davy_yg left a reply on Laravel Real Time Chat App • 4 days ago

I can only recommend you a free chat system like jivochat.com, unless if you want to custom everything that you probably have to create one yourself.

davy_yg left a reply on Laravel Real Time Chat App • 4 days ago

Are you trying to make a chat room or only alive chat?

davy_yg started a new conversation Testing Laravel • 4 days ago

Dear all,

I think I need some help and guides on testing since this is my first time. I am trying to create a simple data test on a website that my friend creates.

First this is my data on:

tests/Features/ExampleTest.php

namespace Tests\Feature;

use Tests\TestCase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;

class ExampleTest extends TestCase
{
    /**
    * A basic test example.
    *
    * @return void
    */

public function testBasicTest()
    {
        $response = $this->get('/');

        $response->assertStatus(200);
    }

    public function filling_order()
    {

    $order = factory(App\Orders::class)->create(); 

    }

}

C:\xampp\htdocs\victoryeshop\vito>phpunit

PHP Fatal error: Uncaught Error: Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() in C:\xampp\htdocs\victoryeshop\vito\vendor\phpunit\phpunit\src\TextUI\TestRunner.php:1066 Stack trace: #0 C:\xampp\htdocs\victoryeshop\vito\vendor\phpunit\phpunit\src\TextUI\TestRunner.php(163): PHPUnit_TextUI_TestRunner->handleConfiguration(Array) #1 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(176): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array) #2 C:\xampp\php\pear\PHPUnit\TextUI\Command.php(129): PHPUnit_TextUI_Command->run(Array, true) #3 C:\xampp\php\phpunit(46): PHPUnit_TextUI_Command::main() #4 {main} thrown in C:\xampp\htdocs\victoryeshop\vito\vendor\phpunit\phpunit\src\TextUI\TestRunner.php on line 1066

Line 1066: $testdoxGroupConfiguration = $arguments['configuration']->getTestdoxGroupConfiguration();

I also don't understand why I am getting the error message and how to debug it.

I also in the middle of watching the Testing Laravel video.

Thanks in advance.

davy_yg left a reply on Edit Pages Error • 4 days ago

I can only hope that I can get a hold of the basic soon.

I have been learning laravel for around 6 months up to now.

Here is my PageController.php

public function show($id)
    {
        // Edit Page

        $pages = Pages::find($id);
    
        return view('soulfy.edit_pages', ['pages' => $pages]);
    }

edit_pages.blade.php

<form action="{{ route('pages.store') }}" method="post">
                        {{ csrf_field() }}

                    <div style="color: white;">Page Name: <input type="text" name="pages_name" size="10" value="{{ $pages }}"><br><br></div>

                    <div style="color: white;">Page Title: <input type="text" name="pages_title" size="10" value=""><br><br></div>
                        
                    <textarea id="particle" name="pages_content" rows="20" cols="70">
                    </textarea><br><br>

                    </div></div> 

                    <div style="padding: 20px;"><input type="submit" class="btn btn-green" data-id="" data-tittle="" data-content="" value="Update"></div>

                    </form>

Do I need to redefine the databases in my view also then call the array?

Can I not pass all the data from the controller? How many data data do I need to pass if I need about 3 values in my views?

value="{{ $pages }}" seems to work but no value appearing if I write value="{{ $pages->pages_name then I start getting error about object.

davy_yg started a new conversation Cachet • 5 days ago

What about Cachet. Is it free ?

To inform the user just like a blogger?

You can create that all with laravel right?

Thanks.

davy_yg started a new conversation Intro • 5 days ago

Hello,

I just watches Spark introduction video. What is it all about?

Is it to data and bill your team member and revenue?

Thanks in advance.

13th October, 2017

davy_yg started a new conversation Profile • 5 days ago

I wonder why I cannot view everyone profile?

by clicking @user_name ?

What's make someone profile viewable ?

Thanks in advance.

davy_yg left a reply on Edit Pages Error • 5 days ago

ErrorException in df2cc2675ccd2db38941c825b30c3ebd line 57: Trying to get property of non-object (View: C:\xampp\htdocs\soulfy_repo\framework\resources\views\soulfy\edit_pages.blade.php)

davy_yg left a reply on Show Pages Name • 5 days ago

@kenny11 - you don't have to reply to my thread if it bothers you.

@36864 - thanks.

davy_yg left a reply on Edit Pages Error • 5 days ago

Now, how to pull the old data into the edit form?

edit_pages.blade.php

<form action="{{ route('pages.store') }}" method="post">
                        {{ csrf_field() }}

                    <div style="color: white;">Page Name: <input type="text" name="pages_name" size="10" value="{{ $pages->pages_name }}"><br><br></div>

                    <div style="color: white;">Page Title: <input type="text" name="pages_title" size="10" value=""><br><br></div>
                        
                    <textarea id="particle" name="pages_content" rows="20" cols="70">
                    </textarea><br><br>

                    </div></div> 

                    <div style="padding: 20px;"><input type="submit" class="btn btn-green" data-id="" data-tittle="" data-content="" value="Update"></div>

                    </form>

PageController.php

public function show($id)
    {
        // Edit Page

        $pages = Pages::find($id)

        return view('soulfy.edit_pages', ['pages' => $pages]);
    }

FatalThrowableError in PageController.php line 80: Parse error: syntax error, unexpected 'return' (T_RETURN)

line 80: return view('soulfy.edit_pages', ['pages' => $pages]);

davy_yg left a reply on Insert Page • 5 days ago

@tomopongrac

Is CSRF Protection required for ALL forms to be safe?

davy_yg left a reply on Show Pages Name • 5 days ago

@kenny11 - I read everything, I just don't like your normal reply about forcing me to search the google. Even after I search the google - I still have another question.

Besides that I can only select one best answer which I think fits my needs. It's my thread anyway.

davy_yg left a reply on Show Pages Name • 5 days ago

@kenny11, Gee I did marked it solve when I am satisfy with the solution and I did reply as I like.

@all:

I wonder why this does not works:

$pages_name = Pages::where('user_id', $user->id)->get('pages_name');

This does works:

$pages = Pages::where('user_id', $user->id)->get();

I finally can see the page comes out.

davy_yg left a reply on Resource Controller • 5 days ago

I don't think I am ready for upgrade since there are more than 1 developer that help adding feature. Me and the other one out source and it cost the owner money.

I also only can spot one difference regarding the version. Like the route is still using Route::controller which only exist in version 5.1

I also do not know what to replace that with. I also cannot list all the difference between the two version and what are all the things that I need changes.

davy_yg left a reply on Resource Controller • 5 days ago

Is it the same thing like writing:

php artisan make:controller Test2Controller

// without --resource

Since I cannot write --resource and works.

C:\xampp\htdocs\soulfy_repo\framework>php artisan make:controller Test2Controller --resource

[RuntimeException] The "--resource" option does not exist.

I think my laravel version is still 5.1 since the program that I add features is old. It will takes sometimes if I want to upgrade. At least wait until I am good with laravel if not I might create big problem that I do not know how to fix later if I upgrade it. 5.1 --> 5.5 is a BIG difference RIGHT?

davy_yg left a reply on Show Pages Name • 5 days ago

It doesn't make any different.

davy_yg started a new conversation Resource Controller • 5 days ago

Hello,

What does this syntax means:

php artisan make:controller PhotoController --resource

I check it here: https://laravel.com/docs/5.5/controllers

C:\xampp\htdocs\soulfy_repo\framework>php artisan make:controller Test2Controller --resource

[RuntimeException] The "--resource" option does not exist.

without resource is working, is it the same thing?

Is resource means using route::resource ?

davy_yg left a reply on Edit Pages Error • 6 days ago

I have pages_id column . Should I use pages_id instead of id ?

davy_yg left a reply on Show Pages Name • 6 days ago

I still having this error message after writing the for each

FatalThrowableError in Grammar.php line 107: Type error: Argument 1 passed to Illuminate\Database\Grammar::columnize() must be of the type array, string given, called in C:\xampp\htdocs\soulfy_repo\framework\vendor\laravel\framework\src\Illuminate\Database\Query\Grammars\Grammar.php on line 108

davy_yg left a reply on Show Pages Name • 6 days ago

davy_yg started a new conversation Show Pages Name • 6 days ago

HomeController.php

public function getAdminPages()
    {

        $domain = $_SERVER['SERVER_NAME'];
        $user = User::where('domain', $domain)->first();  
    
        $pages_name = Pages::where('user_id', $user->id)->get('pages_name');
          

        return view('soulfy.apages', ['pages_name' => $pages_name]);
    }

I am trying to print out all the pages name for a certain user_id. How to write the view?

I am getting this error message:

FatalThrowableError in Grammar.php line 107: Type error: Argument 1 passed to Illuminate\Database\Grammar::columnize() must be of the type array, string given, called in C:\xampp\htdocs\soulfy_repo\framework\vendor\laravel\framework\src\Illuminate\Database\Query\Grammars\Grammar.php on line 108

davy_yg started a new conversation Edit Pages Error • 6 days ago

routes.php

Route::get('/home/editpages/{id}', '[email protected]')->name('home-editpages');

HomeController.php

public function getEditPages(Request $request, $id)
    {
        
        $pages = Pages::find($id);
        $pages->pages_name = $request['pages_name'];
        $pages->pages_content = $request['pages_content'];
        $pages->update();

    session()->flash('status', 'Page has been updated');    
    return view('soulfy.particle');
    }

apages.php

Pages #1 
                    <!-- btn-act-edit -->
                    <a href="{{ route('home-editpages')}}" class="btn btn-green" data-id="" data-tittle="" data-content="">Edit</a>
                    <a href="#" class="btn btn-green" data-id="" data-tittle="" data-content="">Delete</a>

When I press Edit button:

QueryException in Connection.php line 666: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'cms_pages.id' in 'where clause' (SQL: select * from cms_pages where cms_pages.id = {id} limit 1)

I do not know how to fill the id?

Edit Your Profile
Update

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