gman01

gman01

Member Since 3 Years Ago

Experience Points 6,680
Experience Level 2

3,320 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 51
Lessons
Completed
Best Reply Awards 0
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.

11 Sep
4 days ago

gman01 started a new conversation Nova Display Value From Other Table In Index

Hi,

I have 2 resources/models and I want to display a value from a resource on a index, this works fine, but then when i go to update the detail from the index, I get an error trying to get property of non object. I don't want this value to be updated though, only displayed on the index. I don't want to make the field but display it on the index if that makes sense.

Any ideas on what I am doing wrong?

    DateTime::make('Apt Time', function () { return $this->appointments->first()->apt_time; })->showOnIndex()->format('DD MMM YYYY HH:mm'),

Thanks

09 Aug
1 month ago

gman01 started a new conversation Nova

Hi,

I have developed an app for my business using Laravel. I did really enjoy it and it has been a solid little programme. It was around 3 years ago now.

I am looking at doing another little project. Now I just noticed Nova and thought it looks really good. Is there any pros or cons in using it?

Thanks

10 Feb
7 months ago

gman01 left a reply on Laravel Server 500 Error

Ah! Dam... that fixed it!

gman01 started a new conversation Laravel Server 500 Error

Hi,

I've installed a new Laravel project on my server, which hosts a few other laravel projects. I've installed it the same way as the previous ones.

I'm getting this error message below, server error 500.

Laravel Framework 5.7.24

7888#0: *198478 FastCGI sent in stderr: "PHP message: PHP Parse error: syntax error, unexpected '=' in /var/www/vhosts/mydomain.com/stats.mydomain.co.uk/reporting/vendor/laravel/framework/src/Illuminate/Support/Arr.php on line 388" while reading response header from upstream
19 Mar
1 year ago

gman01 started a new conversation OrderBy Date & Time

Hi, I have a database that has 2 columns, date_of_callback, time_of_callback

date_of_callback = 2018-02-22 time_of_callback = 4:30pm

I seem to get the date_of_callback in order, but the time_of_callback can be anytimes, what would be the best way to sort by date and then time?

            $clients =  Client::orderBy('date_of_callback', 'ASC')
                ->orderBy('time_of_callback', 'ASC')
                ->where('lead_status', 'LIKE', "%Callback%")
                ->paginate(15);

        }

15 Mar
1 year ago

gman01 left a reply on Encrypt Data

Thanks M-rk, that makes total sense and something I had not thought about!

gman01 started a new conversation Encrypt Data

Hi, I currently have an Laravel app that has been working quite well for a few years now. It really does serve its purpose.

However, I am thinking of encrypting all the data in the Mysql database in/out. I was looking at encrypting the MYSQL data using the AES technique I have been reading up on.

Then i was looking to see if Lavavel has an inbuilt encryption method in it. How would i be able to incorporate the inbuilt method and would it mess up the current data in the database, would i have to convert the existing records in the database? is the inbuilt method only really good for new applications?

Thanks

05 Jan
1 year ago

gman01 left a reply on API

Hi

Sorry I missed getting back to this.

Problem is I have a lot of affiliates using wordpress to generate leads which come in via email and they have to be inputted manually. I was wondering if I could generate an XML API and let them pass the leads into the system.

?

19 Nov
1 year ago

gman01 left a reply on Create This Funtion In Larvarel

How could I import that function into larvarel, would I have to make it into a service?

gman01 started a new conversation Create This Funtion In Larvarel

Hi

How could I use this funtion in Larvarel? Thanks

// NOTE: The php_soap.dll extension must be enabled in the php.ini file.
function IsValid($number)
{
  $params = array(
    "username" => "your-username",
    "password" => "your-password",
    "number" => $number,
    "options" => $options
  );
  $client = new SoapClient("https://webservices.data-8.co.uk/MobileValidation.asmx?WSDL");
  $result = $client->IsValid($params);
  if ($result->IsValidResult->Status->Success == 0)
  {
    echo "Error: " . $result->IsValidResult->Status->ErrorMessage;
  }
  else
  {
    // TODO: Process method results here.
    // Results can be extracted from the following fields:
    // $result->IsValidResult->Result
    //   The status of the mobile telephone number query, either Success (subscriber available), Unavailable (subscriber has a temporary error), Invalid (subscriber has a permanent error), TimedOut (the query did not return within the time) or Error (an unknown error occurred).
    // $result->IsValidResult->CountryISO
    //   The ISO of the country the mobile telephone originates from.
    // $result->IsValidResult->Organisation
    //   The organisation which the mobile telephone originates from.
    // $result->IsValidResult->NetworkName
    //   The network which the mobile telephone originates from.
    // $result->IsValidResult->NetworkType
    //   The type of mobile network the mobile telephone originates from.
    // $result->IsValidResult->Ported
    //   Whether the mobile telephone is ported.
    // $result->IsValidResult->PortedFromOrganisation
    //   If the number is ported, the organisation the mobile telephone has been ported from.
    // $result->IsValidResult->PortedFromNetwork
    //   If the number is ported, the network the mobile telephone has been ported from.
    // $result->IsValidResult->LocationISO
    //   The country ISO that the mobile is currently located in.
  }
}
13 Nov
1 year ago

gman01 started a new conversation HTTP GET Service For Uk Live Number Validation

Hi, I'm looking to use as service to check UK number live. I've been given it as below, how would i best use this service, I currently collect the details and store them in the database, after it has been stored I'd like it to use the service to ping the number, then display the results at the side of the number...

HTTP GET

The following is a sample HTTP GET request and response. The placeholders shown need to be replaced with actual values.

GET /TelephoneLineValidation.asmx/IsValidSimple?username=string&password=string&number=string HTTP/1.1
Host: webservices.data-8.co.uk
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<TelephoneLineValidationOutput xmlns="http://www.data-8.co.uk/integr8">
  <Status>
    <Success>boolean</Success>
    <ErrorMessage>string</ErrorMessage>
    <CreditsRemaining>float</CreditsRemaining>
  </Status>
  <Result>Valid or Invalid or TemporaryInvalid or Unknown or Error or TimedOut or NumberChanged</Result>
</TelephoneLineValidationOutput>
20 Sep
1 year ago

gman01 started a new conversation API

Hi,

Looking for a bit of advice, I built a little system in Laravel to look after our data. At the minute we have enquiries that come to an email address from web form and we manually input them into the system. I'm looking at a way of passing the enquiries straight into the system via an API so we can cut out the workload of inputting the data.

Anyone had any good experiences on the best way to do this.

Thanks

23 Jan
2 years ago

gman01 started a new conversation Check User Looking At Current Record

Hi,

I've built a little system for my business to track user records. I'm looking to be able to display when a user is logged in and currently looking at a record to another user, like an alert message. I've looked at some way of locking a record but im not bothered about locking the record.

Thanks

19 Nov
2 years ago

gman01 left a reply on Search Between Dates

What an idiot... found the problem somewhere else!

gman01 started a new conversation Search Between Dates

Hi,

I'm trying to search between dates on the create_at timestamp. The date is coming from a date select form in the format Y/M/D.

I can search normal string date time in a table field but not timestamps...

Thanks for any help.


          // Get current week.
                $startOfCurrentWeek = Carbon::now()->startOfWeek()->format('Y/m/d');
        

                //Get End of week.
           $endOfCurrentWeek = Carbon::now()->endOfWeek()->format('Y/m/d');

            $agreeSol = Solution::where('user_id', '=', $currentUserId)
                             ->where('created_at','>=',$startOfCurrentWeek)
                             ->where('created_at','<=',$endOfCurrentWeek)->get()
                             ->where('status', 'Accepted')->count('status');

16 Nov
2 years ago

gman01 started a new conversation User Log Tracking

Hi,

I'm looking to be able to track all Users, what part pf the system they look at, by Ip address etc.

Is there a ready made solution for this that can be integrated, i found a simple activity logger however the page was down.

Thanks

28 Oct
2 years ago

gman01 started a new conversation Storage S3

Hi,

Looking for some advice. I am current storing files on the server from files that are uploaded by users.

I was thinking of using Amazon S3 simple Storage. I was wondering if a idea would be to mount an Amazon s3 bucket as a folder (the server is running ubuntu) then uploading the files to this this mount?

Would there be any overheads uploading files and storing them that way? The files that are being uploaded are quite big and quite a few of them per user.

Thanks

17 Oct
2 years ago

gman01 left a reply on Forcing A Unique Rule To Ignore A Given ID:

Thanks for the reply... Would i get this from the update controller? ClientRequestId

       public function update($id, ClientRequest $request)
           {

            $client = Client::findOrFail($id);
            
            $client->update($request->all());


            $request->session()->flash('status', 'Case has been updated.');

            return redirect('clients');

       }

gman01 started a new conversation Forcing A Unique Rule To Ignore A Given ID:

Hi,

I'm trying to use this part from the Larvarel documentation

Forcing A Unique Rule To Ignore A Given ID: I simply don't want it to do the check on edit and update. Only on the initial create. Create works fine.

In the controller I am collecting the $id but the rule does not notice it. However the below works when i hard code it in.

Do i have to make a custom rule to pass the ID?

    public function rules()
    {
        return [
            'lead_code' => 'required|min:3|unique:clients,lead_code, 7',                         
            //'lead_code' => 'required|min:3',
            'mobile' => 'required|phone:AUTO,GB,mobile',

        ];
    }
09 Oct
2 years ago

gman01 left a reply on Dropzone Upload

Spent so much time on this then i tried "success" and that seems to be working... "complete" will try complete. Thanks.

                this.on("success", function(files, response) {
                location.href = '/documents/{{$documents->id}}';  // this will redirect you when the file is added to dropzone
                //location.reload();
                });
```

gman01 started a new conversation Dropzone Upload

Hi,

I am uploading multiple files using Dropzone. It seems to work fine apart from when i redirect the page after upload, lets say I have uploaded 8 files, then it will only show 4 or 5 after the redirect. If I refresh the page manually then they all appear. They are also going into the database fine.

It seems to redirect before all the files are upload. When I add the uploadMultiple: true then I don't seem to be able to upload anything.


    public function show(Client $documents)

    {

        return view('documents.show', compact('documents', 'client_id'));
    }

    public function addDocument($documents, DocumentRequest $request)
     {
      
    
      $file = $request->file('document');

      $name = time() . $file->getClientOriginalName();

      $file->move('client/docs', $name);

      $document = Client::findOrFail($documents);

      $document->user_id = $request->user_id;

      $document->doc_type = $request->doc_type;


      $document->documents()->create(['document' => "/client/docs/{$name}", 'doc_type' => "{$document->doc_type}", 'user_id' => "{$documents}"]);

      $request->session()->flash('status', 'Document(s) has been uploaded.');        


    


     }

                           <!-- Place Holder -->
                            <h3>Add Documents</h3>

                            <hr>
                        

                             <form id="myDropzone" action="/documents/add/{{$documents->id}}" enctype="multipart/form-data" method="POST" class="dropzone">
                               <input type="hidden" name="user_id" value="{{$documents->id}}" />

                            <div class="dropzone-previews"></div> <!-- this is were the previews should be shown. -->
                          
                             {{ csrf_field() }}
 <div class="row">
      <div class="col-xs-4">
            <div class="form-group">
                    {!! Form::label('doc_type', 'Document Type:') !!}

                    {!! Form::select('doc_type', 
                              ['Photo ID' => 'Photo ID', 
                               'Statements' => 'Statements',
                               'Utility Bills' => 'Utility Bills',
                               'E-sign docs' => 'E-sign docs',
                               'Misc Documents' => 'Misc Documents'], null, ['class' => 'form-control', 'placeholder' => 'Please select...']) !!}

      </div>
  </div>
</div>
                            <div class="form-group">
                               <button id="submit-all" class="btn btn-primary">Submit all files</button>
                            </div> 
                            <hr>
                             </form>
                           
                          

                          @else
                                <div class="alert alert-danger">
                                    <strong>Sorry!</strong> 
                                </div>       
                           @endrole

                                </div>  
                          </div>  
                    </div>  
            </div>  
       </div>  
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.3.0/dropzone.js"></script>
<script>

        Dropzone.options.myDropzone = {

          // Prevents Dropzone from uploading dropped files immediately
          paramName: 'document',
          //uploadMultiple: true,
          autoProcessQueue: false,         

          parallelUploads: 100,
          maxFilesize: 30,
          acceptedFiles: '.gif, .png, .jpeg, .jpg, .bmp, .pdf, .xlsx',
          dictDefaultMessage: "Drop client case documents here",



          init: function() {
            var submitButton = document.querySelector("#submit-all")
                myDropzone = this; // closure

            submitButton.addEventListener("click", function() {
              myDropzone.processQueue(); // Tell Dropzone to process all queued files.



            });

            this.on("successmultiple", function(files, response) {
            location.href = '/documents/{{$documents->id}}';  // this will redirect you when the file is added to dropzone
            //location.reload();
            });


          }
        };

</script>


02 Oct
2 years ago

gman01 left a reply on Shinobi Check For Multiple Roles

Hey thanks for the reply.

I am using

https://github.com/caffeinated/shinobi

I've tried various ways, it does say you can add multi roles to a user, but no real documentation i can find to do it. I get a parse error on various things i try.

30 Sep
2 years ago

gman01 started a new conversation Shinobi Check For Multiple Roles

Hi,

Don't suppose anyone has an idea if its possible to check for multiple roles using this package?

     @role('admin')
                                I am an Admin/advisor User
                            @else
                            @endrole

Tried below but it throws an error.

@role('admin|advisor', 'all') // @if(Auth::check() && Auth::user()->is('admin|moderator', 'all'))
    // user is admin and also moderator
@else
    // something else
@endrole

gman01 started a new conversation Shinobi Auth

Hi,

I am currently using Shinobi to manage Role based authentication. I have got it working ok with set Roles.

My app is an in-house app, I'm struggling trying to put the 'register' controller under authentication, I only want an admin to be able to add users.

G

29 Sep
2 years ago

gman01 left a reply on PDF Output

@InaniELHoussain

Thank-you. Started using it today and it does exactly what i need.

28 Sep
2 years ago

gman01 started a new conversation PDF Output

Hi,

I've got a little system built in Laravel, what i'm looking into doing is outputting data into a nice downloadable PDF...

is there any packages anyone can recommend? I found one or 2 looking around but wondered if anyone has had any good experience or can recommend one.

Thanks

gman01 left a reply on Query Builder Where

Oh that worked! Owe you a Coffee!

I'd tried all kinds of ways.

gman01 left a reply on Query Builder Where

Don't be sorry need all the help i can get :)

So that gave...

Call to a member function get() on a non-object

gman01 left a reply on Query Builder Where

Still get a Parse error in the controller.

gman01 started a new conversation Query Builder Where

Hi,

Trying to get the total sum of a column where the client = something. I've looked at the larvarel docs but

This works fine but gets all the columns.

$creditorDebt = Creditors::sum('creditor_balance');

Tried below but get a parse error.

 $creditorDebt = Creditors::table('creditor_info')->where('client_id' '=' $client_id)->sum('creditor_balance');

15 Sep
3 years ago

gman01 left a reply on Inserting Client_id

@Prullenbak Thanks for that.

I realised i'd made a real stupid error somewhere else also. Keep it simple :)

gman01 left a reply on Inserting Client_id

So if i do the below i get one of the form values stored into the database but the user_id and client_id doesn't get passed.

        public function store(Request $request)
        {

            Profile::create($request->all());
         
            //return $request->all();    
           //$new_profile = new Profile($request->all());

           //$new_profile->user_id = $request->user()->id;

           //$new_profile->client_id = $request->client_id;

           //$profile->profile()->save($new_profile);

        return back();
        
        }

gman01 left a reply on Inserting Client_id

still doesn't seem to insert. The profile belongs to the Client.

this is the client class.

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Client extends Model
{
    protected $fillable = [
        'lead_code',
        'product_id',
        'employment_id',
        'housing_id',
        'user_id',
        'marital_id',
        'occupation_id',
        'name', 
        'surname',
        'date_of_birth',
        'employer_name',
        'cdate_of_employment',
        'answeryesno_id',
        'pemployment_id',
        'partner_name', 
        'partner_surname',
        'partner_date_of_birth',
        'dependant1_age',
        'dependant2_age',
        'dependant3_age',
        'dependant4_age',
        'dependant5_age',
        'dependant6_age',
        'landline',
        'mobile',
        'email',
        'plandline',
        'pmobile',
        'pemail'

    ];

        
    public function notes()     
        {
            return $this->hasMany(Note::class)->orderBy('created_at', 'desc');
            
        }

    public function product(){
        return $this->belongsTo(Product::class);
    }

    public function employment(){
        return $this->belongsTo(Employment::class);
    }

    public function pemployment(){
        return $this->belongsTo(Employment::class);
    }

    public function housing(){
        return $this->belongsTo(Housing::class);
    }

    public function marital(){
        return $this->belongsTo(Marital::class);
    }

    public function occupation(){
        return $this->belongsTo(Occupation::class);
    }

    public function answeryesno(){
        return $this->belongsTo(Answeryesno::class);
    }

    public function user(){
        return $this->belongsTo(User::class);
    }

       public function profile(){
        return $this->hasOne(Profile::class);
    }

    public function setLeadCodeAttribute($value)
    {
    $this->attributes['lead_code'] = strtoupper($value);
    }

}

gman01 left a reply on Inserting Client_id

I get:

{"_token":"XgOgPJrVJX5eyWwyqJQ19hkr3t5Zyd0UcvlO1hCA","promted_inquiry":"need help ","client_id":"3"}

gman01 left a reply on Inserting Client_id

@TerrePorter

Yes it is making it to the form. So in that case i don't need to send it via a hidden field?

gman01 started a new conversation Inserting Client_id

Hi,

This will be quite simple to some but I am learning... Laracasts videos are great by the way.

I have a clients table that inserts into the database, updates etc. I'm now trying to build a profile table which belong to the client table.

I'm trying to insert the client_id into the profile table but I don't seem to be able to figure how to pass it to the store function.

I get the error code:

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'client_id' cannot be null (SQL: insert into profile (promted_inquiry, user_id, client_id, updated_at, created_at) values (need help, 1, , 2016-09-15 11:23:56, 2016-09-15 11:23:56))

Route

Route::get('profile/{client_id}/create/', '[email protected]');

Route::post('profile/{client_id}', '[email protected]');

ProfileController

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Client;
use App\User;
use App\Profile;
use App\Http\Requests\ClientRequest;
use App\Http\Requests\ProfileRequest;

use App\Http\Requests;

class ProfileController extends Controller
{
     /**
     * Create a new controller instance.
     *
     * @return void
     */
       public function __construct()
        {
            $this->middleware('auth');
        }

     /**
     * Show a new controller instance.
     *
     * @return void
     */    
        public function show(Client $profile)
        {

        $profile->load('profile.user');

        return view('profile.show', compact('profile'));
       
    }

        public function create($client_id)
        {

        return view('profile.create', compact('client_id'));
       
        }

        public function store(Request $request, Client $profile, $client_id)
        {
         
            //return $request->all();    
           $new_profile = new Profile($request->all());

           $new_profile->user_id = $request->user()->id;

           $new_profile->client_id = $client_id;

           $profile->profile()->save($new_profile);

        return back();
        
        }
}

                <h3>Add Profile</h3>

                      <form method="POST" action="/profile/{{$client_id}}">
                       {{ csrf_field() }}
                         <div class="form-group">
                          <textarea name="promted_inquiry" class="form-control"></textarea>
                                                   </div>


                         <div class="form-group">
                          <button type="submit" class="btn btn-primary">Add Profile</button>
                         </div>
                      </form>

09 Sep
3 years ago

gman01 left a reply on Edit Date In Form

Good idea. Thanks Tykus.

gman01 left a reply on Edit Date In Form

I can get it out like this & it updates fine. But i'm using the same form to also create a record also and then it breaks.

     <div class="col-xs-4">
                        <div class="form-group">
                        {!! Form::label('date_of_birth', 'Date of Birth:') !!}
                        {!! Form::date('date_of_birth', date($client->date_of_birth), ['class' => 'form-control']) !!}

                </div>                 
            </div>





gman01 started a new conversation Edit Date In Form

Hi, Me again!

I'm building an edit form and the date of Birth shows the default (d-m-y), doesn't fetch from the database. Whats the best way to add this in?

            <div class="col-xs-4">
                        <div class="form-group">
                        {!! Form::label('date_of_birth', 'Date of Birth:') !!}
                        {!! Form::date('date_of_birth', date('D-m-y'), ['class' => 'form-control']) !!}

                </div>                 
            </div>

gman01 left a reply on App\Http\Controllers\Auth Not Found.

Yes I was calling something else as well that was conflicting with it.

08 Sep
3 years ago

gman01 left a reply on App\Http\Controllers\Auth Not Found.

I had tried adding it at the top but I still get the same error.

gman01 started a new conversation App\Http\Controllers\Auth Not Found.

Hi,

I'm trying to get all rows where user = logged in user, but keep getting:

Class 'App\Http\Controllers\Auth' not found, I've tried adding it in to the top of the controller.

<?php

use Illuminate\Support\Str;

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\User;

use App\Client;

use App\Note;

use App\Product;

use App\Http\Requests\ClientRequest;

use App\Http\Requests;

use Carbon\Carbon;

class MyClientsController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('auth');
    }

    public function index() {
      
         $clients = Client::where('id', Auth::user()->id)->get();

         return view('my_clients.index', compact('clients'));
    }
}

07 Sep
3 years ago

gman01 started a new conversation Strtoupper(

Hi,

What would be the best way to Convert a string to uppercase before entering it into a database table?

Thanks

02 Sep
3 years ago

gman01 left a reply on Output Table

Hi Thanks..I looked on those and did it that way thanks. .

gman01 left a reply on Output Table

Sorry i'd noticed.

gman01 started a new conversation Output Table

Hi,

What would be the best way of outputting this, I'm looking to output the product_type column that joins the product name.

clients

id
product_type
name,
surname

products

id
name

I populate the clients column product_type using a dropdown menu which inserts the id from the products table.

I want to output it on the page that has a foreach in which outputs some client stuff.

   <td>{{ $client->product_type}}</td> // This gives me 1 2 the array keys
   <td>{{ $products }}</td> // gives me the array names ["ILS Con","Company"] 
    <td>{{ $products[0] }} </td>    // Gives me ILS Con 

              @foreach ($clients as $client)
                      <td>{{ $client->lead_code }}</td>
                      <td>{{ $client->product_type}}</td>
                      <td>{{ $products }}</td>
                       <td>{{ $products[0] }}</td>
      
                      <td>{{ $client->name }} {{ $client->surname }}</td>
                      <td>Dummy data</td>
                      <td><span class="label label-success">Agreed</span></td>
                      <td><span class="label label-success">Completed</span></td>
                      <td><span class="label label-success">Success</span></td>
                      <td><a href="/products/edit"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span></a></td>
         </tr>
              @endforeach
23 Aug
3 years ago

gman01 left a reply on Laravel / Tinker Error

I just retried it by creating a table clients and model client. Worked fine.

is "Case" reserved anywhere, could that be the problem?

gman01 left a reply on Laravel / Tinker Error

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Case extends Model
{
       protected $fillable = [
        'name', 
        'surname'
    ];
}

gman01 left a reply on Laravel / Tinker Error

I restarted Tinker.